Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Side by Side Diff: webrtc/base/fakenetwork.h

Issue 1920043002: Replace scoped_ptr with unique_ptr in webrtc/base/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/base/diskcache.cc ('k') | webrtc/base/fakesslidentity.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_BASE_FAKENETWORK_H_ 11 #ifndef WEBRTC_BASE_FAKENETWORK_H_
12 #define WEBRTC_BASE_FAKENETWORK_H_ 12 #define WEBRTC_BASE_FAKENETWORK_H_
13 13
14 #include <memory>
14 #include <string> 15 #include <string>
15 #include <utility> 16 #include <utility>
16 #include <vector> 17 #include <vector>
17 18
18 #include "webrtc/base/network.h" 19 #include "webrtc/base/network.h"
19 #include "webrtc/base/messagehandler.h" 20 #include "webrtc/base/messagehandler.h"
20 #include "webrtc/base/socketaddress.h" 21 #include "webrtc/base/socketaddress.h"
21 #include "webrtc/base/stringencode.h" 22 #include "webrtc/base/stringencode.h"
22 #include "webrtc/base/thread.h" 23 #include "webrtc/base/thread.h"
23 24
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 std::vector<Network*> networks; 93 std::vector<Network*> networks;
93 for (IfaceList::iterator it = ifaces_.begin(); 94 for (IfaceList::iterator it = ifaces_.begin();
94 it != ifaces_.end(); ++it) { 95 it != ifaces_.end(); ++it) {
95 int prefix_length = 0; 96 int prefix_length = 0;
96 if (it->first.ipaddr().family() == AF_INET) { 97 if (it->first.ipaddr().family() == AF_INET) {
97 prefix_length = kFakeIPv4NetworkPrefixLength; 98 prefix_length = kFakeIPv4NetworkPrefixLength;
98 } else if (it->first.ipaddr().family() == AF_INET6) { 99 } else if (it->first.ipaddr().family() == AF_INET6) {
99 prefix_length = kFakeIPv6NetworkPrefixLength; 100 prefix_length = kFakeIPv6NetworkPrefixLength;
100 } 101 }
101 IPAddress prefix = TruncateIP(it->first.ipaddr(), prefix_length); 102 IPAddress prefix = TruncateIP(it->first.ipaddr(), prefix_length);
102 scoped_ptr<Network> net(new Network(it->first.hostname(), 103 std::unique_ptr<Network> net(new Network(it->first.hostname(),
103 it->first.hostname(), prefix, 104 it->first.hostname(), prefix,
104 prefix_length, it->second)); 105 prefix_length, it->second));
105 net->set_default_local_address_provider(this); 106 net->set_default_local_address_provider(this);
106 net->AddIP(it->first.ipaddr()); 107 net->AddIP(it->first.ipaddr());
107 networks.push_back(net.release()); 108 networks.push_back(net.release());
108 } 109 }
109 bool changed; 110 bool changed;
110 MergeNetworkList(networks, &changed); 111 MergeNetworkList(networks, &changed);
111 if (changed || !sent_first_update_) { 112 if (changed || !sent_first_update_) {
112 SignalNetworksChanged(); 113 SignalNetworksChanged();
113 sent_first_update_ = true; 114 sent_first_update_ = true;
114 } 115 }
115 } 116 }
116 117
117 Thread* thread_; 118 Thread* thread_;
118 IfaceList ifaces_; 119 IfaceList ifaces_;
119 int next_index_ = 0; 120 int next_index_ = 0;
120 int start_count_ = 0; 121 int start_count_ = 0;
121 bool sent_first_update_ = false; 122 bool sent_first_update_ = false;
122 123
123 IPAddress default_local_ipv4_address_; 124 IPAddress default_local_ipv4_address_;
124 IPAddress default_local_ipv6_address_; 125 IPAddress default_local_ipv6_address_;
125 }; 126 };
126 127
127 } // namespace rtc 128 } // namespace rtc
128 129
129 #endif // WEBRTC_BASE_FAKENETWORK_H_ 130 #endif // WEBRTC_BASE_FAKENETWORK_H_
OLDNEW
« no previous file with comments | « webrtc/base/diskcache.cc ('k') | webrtc/base/fakesslidentity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698