OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
400 static void NotifyObserversOfMaxBandwidthChangeForTests( | 400 static void NotifyObserversOfMaxBandwidthChangeForTests( |
401 double max_bandwidth_mbps, | 401 double max_bandwidth_mbps, |
402 ConnectionType type); | 402 ConnectionType type); |
403 | 403 |
404 // Enable or disable notifications from the host. After setting to true, be | 404 // Enable or disable notifications from the host. After setting to true, be |
405 // sure to pump the RunLoop until idle to finish any preexisting | 405 // sure to pump the RunLoop until idle to finish any preexisting |
406 // notifications. To use this, it must must be called before a | 406 // notifications. To use this, it must must be called before a |
407 // NetworkChangeNotifier is created. | 407 // NetworkChangeNotifier is created. |
408 static void SetTestNotificationsOnly(bool test_only); | 408 static void SetTestNotificationsOnly(bool test_only); |
409 | 409 |
410 // Parses |type| and return the equivalent ConnectionType. | |
RyanSturm
2016/10/12 21:33:34
s/type/connection_type/
tbansal1
2016/10/12 22:04:01
Obsolete.
| |
411 static ConnectionType StringToConnectionType( | |
412 const std::string& connection_type); | |
413 | |
410 // Return a string equivalent to |type|. | 414 // Return a string equivalent to |type|. |
411 static const char* ConnectionTypeToString(ConnectionType type); | 415 static const char* ConnectionTypeToString(ConnectionType type); |
412 | 416 |
413 // Let the NetworkChangeNotifier know we received some data. | 417 // Let the NetworkChangeNotifier know we received some data. |
414 // This is used for producing histogram data about the accuracy of | 418 // This is used for producing histogram data about the accuracy of |
415 // the NetworkChangenotifier's online detection and rough network | 419 // the NetworkChangenotifier's online detection and rough network |
416 // connection measurements. | 420 // connection measurements. |
417 static void NotifyDataReceived(const URLRequest& request, int bytes_read); | 421 static void NotifyDataReceived(const URLRequest& request, int bytes_read); |
418 | 422 |
419 // Register the Observer callbacks for producing histogram data. This | 423 // Register the Observer callbacks for producing histogram data. This |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
575 | 579 |
576 // Set true to disable non-test notifications (to prevent flakes in tests). | 580 // Set true to disable non-test notifications (to prevent flakes in tests). |
577 static bool test_notifications_only_; | 581 static bool test_notifications_only_; |
578 | 582 |
579 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); | 583 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); |
580 }; | 584 }; |
581 | 585 |
582 } // namespace net | 586 } // namespace net |
583 | 587 |
584 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 588 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
OLD | NEW |