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

Side by Side Diff: net/base/network_change_notifier.h

Issue 1549613002: Makes NetworkChangeType enum public. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@datagram
Patch Set: Removes ForTests method. Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 10 #include <vector>
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 SUBTYPE_WIFI_G, 95 SUBTYPE_WIFI_G,
96 SUBTYPE_WIFI_N, 96 SUBTYPE_WIFI_N,
97 SUBTYPE_WIFI_AC, 97 SUBTYPE_WIFI_AC,
98 SUBTYPE_WIFI_AD, 98 SUBTYPE_WIFI_AD,
99 SUBTYPE_UNKNOWN, 99 SUBTYPE_UNKNOWN,
100 SUBTYPE_NONE, 100 SUBTYPE_NONE,
101 SUBTYPE_OTHER, 101 SUBTYPE_OTHER,
102 SUBTYPE_LAST = SUBTYPE_OTHER 102 SUBTYPE_LAST = SUBTYPE_OTHER
103 }; 103 };
104 104
105 // Types of network changes specified to
106 // NotifyObserversOfSpecificNetworkChange.
107 enum NetworkChangeType {
108 CONNECTED,
109 DISCONNECTED,
110 SOON_TO_DISCONNECT,
111 MADE_DEFAULT
112 };
113
105 class NET_EXPORT IPAddressObserver { 114 class NET_EXPORT IPAddressObserver {
106 public: 115 public:
107 // Will be called when the IP address of the primary interface changes. 116 // Will be called when the IP address of the primary interface changes.
108 // This includes when the primary interface itself changes. 117 // This includes when the primary interface itself changes.
109 virtual void OnIPAddressChanged() = 0; 118 virtual void OnIPAddressChanged() = 0;
110 119
111 protected: 120 protected:
112 IPAddressObserver() {} 121 IPAddressObserver() {}
113 virtual ~IPAddressObserver() {} 122 virtual ~IPAddressObserver() {}
114 123
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 public: 443 public:
435 DisableForTest(); 444 DisableForTest();
436 ~DisableForTest(); 445 ~DisableForTest();
437 446
438 private: 447 private:
439 // The original NetworkChangeNotifier to be restored on destruction. 448 // The original NetworkChangeNotifier to be restored on destruction.
440 NetworkChangeNotifier* network_change_notifier_; 449 NetworkChangeNotifier* network_change_notifier_;
441 }; 450 };
442 451
443 protected: 452 protected:
444 // Types of network changes specified to
445 // NotifyObserversOfSpecificNetworkChange.
446 enum NetworkChangeType {
447 CONNECTED,
448 DISCONNECTED,
449 SOON_TO_DISCONNECT,
450 MADE_DEFAULT
451 };
452
453 // NetworkChanged signal is calculated from the IPAddressChanged and 453 // NetworkChanged signal is calculated from the IPAddressChanged and
454 // ConnectionTypeChanged signals. Delay parameters control how long to delay 454 // ConnectionTypeChanged signals. Delay parameters control how long to delay
455 // producing NetworkChanged signal after particular input signals so as to 455 // producing NetworkChanged signal after particular input signals so as to
456 // combine duplicates. In other words if an input signal is repeated within 456 // combine duplicates. In other words if an input signal is repeated within
457 // the corresponding delay period, only one resulting NetworkChange signal is 457 // the corresponding delay period, only one resulting NetworkChange signal is
458 // produced. 458 // produced.
459 struct NET_EXPORT NetworkChangeCalculatorParams { 459 struct NET_EXPORT NetworkChangeCalculatorParams {
460 NetworkChangeCalculatorParams(); 460 NetworkChangeCalculatorParams();
461 // Controls delay after OnIPAddressChanged when transitioning from an 461 // Controls delay after OnIPAddressChanged when transitioning from an
462 // offline state. 462 // offline state.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 559
560 // Set true to disable non-test notifications (to prevent flakes in tests). 560 // Set true to disable non-test notifications (to prevent flakes in tests).
561 static bool test_notifications_only_; 561 static bool test_notifications_only_;
562 562
563 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); 563 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier);
564 }; 564 };
565 565
566 } // namespace net 566 } // namespace net
567 567
568 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ 568 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698