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

Side by Side Diff: webrtc/p2p/base/port.h

Issue 1976683003: Update the type and cost of existing networks if its type is found later by network monitor (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Get network type from name matching only on IOS or Android. Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 candidate_filter_ = candidate_filter; 299 candidate_filter_ = candidate_filter;
300 } 300 }
301 int16_t network_cost() const { return network_cost_; } 301 int16_t network_cost() const { return network_cost_; }
302 302
303 protected: 303 protected:
304 enum { 304 enum {
305 MSG_DEAD = 0, 305 MSG_DEAD = 0,
306 MSG_FIRST_AVAILABLE 306 MSG_FIRST_AVAILABLE
307 }; 307 };
308 308
309 virtual void UpdateNetworkCost();
310
309 void set_type(const std::string& type) { type_ = type; } 311 void set_type(const std::string& type) { type_ = type; }
310 312
311 void AddAddress(const rtc::SocketAddress& address, 313 void AddAddress(const rtc::SocketAddress& address,
312 const rtc::SocketAddress& base_address, 314 const rtc::SocketAddress& base_address,
313 const rtc::SocketAddress& related_address, 315 const rtc::SocketAddress& related_address,
314 const std::string& protocol, 316 const std::string& protocol,
315 const std::string& relay_protocol, 317 const std::string& relay_protocol,
316 const std::string& tcptype, 318 const std::string& tcptype,
317 const std::string& type, 319 const std::string& type,
318 uint32_t type_preference, 320 uint32_t type_preference,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 void OnConnectionDestroyed(Connection* conn); 359 void OnConnectionDestroyed(Connection* conn);
358 360
359 // Whether this port is dead, and hence, should be destroyed on the controlled 361 // Whether this port is dead, and hence, should be destroyed on the controlled
360 // side. 362 // side.
361 bool dead() const { 363 bool dead() const {
362 return ice_role_ == ICEROLE_CONTROLLED && connections_.empty(); 364 return ice_role_ == ICEROLE_CONTROLLED && connections_.empty();
363 } 365 }
364 366
365 void OnNetworkInactive(const rtc::Network* network); 367 void OnNetworkInactive(const rtc::Network* network);
366 368
369 void OnNetworkTypeChanged(const rtc::Network* network);
370
367 rtc::Thread* thread_; 371 rtc::Thread* thread_;
368 rtc::PacketSocketFactory* factory_; 372 rtc::PacketSocketFactory* factory_;
369 std::string type_; 373 std::string type_;
370 bool send_retransmit_count_attribute_; 374 bool send_retransmit_count_attribute_;
371 rtc::Network* network_; 375 rtc::Network* network_;
372 rtc::IPAddress ip_; 376 rtc::IPAddress ip_;
373 uint16_t min_port_; 377 uint16_t min_port_;
374 uint16_t max_port_; 378 uint16_t max_port_;
375 std::string content_name_; 379 std::string content_name_;
376 int component_; 380 int component_;
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 const rtc::PacketOptions& options) override; 676 const rtc::PacketOptions& options) override;
673 int GetError() override { return error_; } 677 int GetError() override { return error_; }
674 678
675 private: 679 private:
676 int error_ = 0; 680 int error_ = 0;
677 }; 681 };
678 682
679 } // namespace cricket 683 } // namespace cricket
680 684
681 #endif // WEBRTC_P2P_BASE_PORT_H_ 685 #endif // WEBRTC_P2P_BASE_PORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698