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

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

Issue 1454313002: Adding platform support check for NetworkObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Fixed typo. Created 5 years, 1 month 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 | net/base/network_change_notifier.cc » ('j') | net/base/network_change_notifier.cc » ('J')
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 <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // called back with notifications. This is safe to call if Create() has not 354 // called back with notifications. This is safe to call if Create() has not
355 // been called (as long as it doesn't race the Create() call on another 355 // been called (as long as it doesn't race the Create() call on another
356 // thread), in which case it will simply do nothing. 356 // thread), in which case it will simply do nothing.
357 static void AddIPAddressObserver(IPAddressObserver* observer); 357 static void AddIPAddressObserver(IPAddressObserver* observer);
358 static void AddConnectionTypeObserver(ConnectionTypeObserver* observer); 358 static void AddConnectionTypeObserver(ConnectionTypeObserver* observer);
359 static void AddDNSObserver(DNSObserver* observer); 359 static void AddDNSObserver(DNSObserver* observer);
360 static void AddNetworkChangeObserver(NetworkChangeObserver* observer); 360 static void AddNetworkChangeObserver(NetworkChangeObserver* observer);
361 static void AddMaxBandwidthObserver(MaxBandwidthObserver* observer); 361 static void AddMaxBandwidthObserver(MaxBandwidthObserver* observer);
362 static void AddNetworkObserver(NetworkObserver* observer); 362 static void AddNetworkObserver(NetworkObserver* observer);
363 363
364 // Returns true if platform supports notifications required for observer.
365 static bool IsNetworkObserverSupported();
366
364 // Unregisters |observer| from receiving notifications. This must be called 367 // Unregisters |observer| from receiving notifications. This must be called
365 // on the same thread on which AddObserver() was called. Like AddObserver(), 368 // on the same thread on which AddObserver() was called. Like AddObserver(),
366 // this is safe to call if Create() has not been called (as long as it doesn't 369 // this is safe to call if Create() has not been called (as long as it doesn't
367 // race the Create() call on another thread), in which case it will simply do 370 // race the Create() call on another thread), in which case it will simply do
368 // nothing. Technically, it's also safe to call after the notifier object has 371 // nothing. Technically, it's also safe to call after the notifier object has
369 // been destroyed, if the call doesn't race the notifier's destruction, but 372 // been destroyed, if the call doesn't race the notifier's destruction, but
370 // there's no reason to use the API in this risky way, so don't do it. 373 // there's no reason to use the API in this risky way, so don't do it.
371 static void RemoveIPAddressObserver(IPAddressObserver* observer); 374 static void RemoveIPAddressObserver(IPAddressObserver* observer);
372 static void RemoveConnectionTypeObserver(ConnectionTypeObserver* observer); 375 static void RemoveConnectionTypeObserver(ConnectionTypeObserver* observer);
373 static void RemoveDNSObserver(DNSObserver* observer); 376 static void RemoveDNSObserver(DNSObserver* observer);
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 551
549 // Set true to disable non-test notifications (to prevent flakes in tests). 552 // Set true to disable non-test notifications (to prevent flakes in tests).
550 static bool test_notifications_only_; 553 static bool test_notifications_only_;
551 554
552 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); 555 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier);
553 }; 556 };
554 557
555 } // namespace net 558 } // namespace net
556 559
557 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ 560 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/network_change_notifier.cc » ('j') | net/base/network_change_notifier.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698