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

Side by Side Diff: net/quic/chromium/mock_network_change_notifier.h

Issue 2329853002: Introduces ability for session to wait on a migration trigger for a new (Closed)
Patch Set: comments addressed Created 4 years, 3 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 | net/quic/chromium/mock_network_change_notifier.cc » ('j') | 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_QUIC_CHROMIUM_MOCK_NETWORK_CHANGE_NOTIFIER_H_ 5 #ifndef NET_QUIC_CHROMIUM_MOCK_NETWORK_CHANGE_NOTIFIER_H_
6 #define NET_QUIC_CHROMIUM_MOCK_NETWORK_CHANGE_NOTIFIER_H_ 6 #define NET_QUIC_CHROMIUM_MOCK_NETWORK_CHANGE_NOTIFIER_H_
7 7
8 #include "net/base/network_change_notifier.h" 8 #include "net/base/network_change_notifier.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 21 matching lines...) Expand all
32 // but does not spin the message loop to actually deliver it. 32 // but does not spin the message loop to actually deliver it.
33 void QueueNetworkMadeDefault(NetworkChangeNotifier::NetworkHandle network); 33 void QueueNetworkMadeDefault(NetworkChangeNotifier::NetworkHandle network);
34 34
35 // Delivers a DISCONNECTED notification to observers. 35 // Delivers a DISCONNECTED notification to observers.
36 void NotifyNetworkDisconnected(NetworkChangeNotifier::NetworkHandle network); 36 void NotifyNetworkDisconnected(NetworkChangeNotifier::NetworkHandle network);
37 37
38 // Queues a DISCONNECTED notification to be delivered to observers 38 // Queues a DISCONNECTED notification to be delivered to observers
39 // but does not spin the message loop to actually deliver it. 39 // but does not spin the message loop to actually deliver it.
40 void QueueNetworkDisconnected(NetworkChangeNotifier::NetworkHandle network); 40 void QueueNetworkDisconnected(NetworkChangeNotifier::NetworkHandle network);
41 41
42 // Delivers a CONNECTED notification to observers.
43 void NotifyNetworkConnected(NetworkChangeNotifier::NetworkHandle network);
44
42 private: 45 private:
43 bool force_network_handles_supported_; 46 bool force_network_handles_supported_;
44 NetworkChangeNotifier::NetworkList connected_networks_; 47 NetworkChangeNotifier::NetworkList connected_networks_;
45 }; 48 };
46 49
47 // Class to replace existing NetworkChangeNotifier singleton with a 50 // Class to replace existing NetworkChangeNotifier singleton with a
48 // MockNetworkChangeNotifier for a test. To use, simply create a 51 // MockNetworkChangeNotifier for a test. To use, simply create a
49 // ScopedMockNetworkChangeNotifier object in the test. 52 // ScopedMockNetworkChangeNotifier object in the test.
50 class ScopedMockNetworkChangeNotifier { 53 class ScopedMockNetworkChangeNotifier {
51 public: 54 public:
52 ScopedMockNetworkChangeNotifier(); 55 ScopedMockNetworkChangeNotifier();
53 ~ScopedMockNetworkChangeNotifier(); 56 ~ScopedMockNetworkChangeNotifier();
54 57
55 MockNetworkChangeNotifier* mock_network_change_notifier(); 58 MockNetworkChangeNotifier* mock_network_change_notifier();
56 59
57 private: 60 private:
58 std::unique_ptr<NetworkChangeNotifier::DisableForTest> 61 std::unique_ptr<NetworkChangeNotifier::DisableForTest>
59 disable_network_change_notifier_for_tests_; 62 disable_network_change_notifier_for_tests_;
60 std::unique_ptr<MockNetworkChangeNotifier> mock_network_change_notifier_; 63 std::unique_ptr<MockNetworkChangeNotifier> mock_network_change_notifier_;
61 }; 64 };
62 65
63 } // namespace test 66 } // namespace test
64 } // namespace net 67 } // namespace net
65 68
66 #endif // NET_QUIC_CHROMIUM_MOCK_NETWORK_CHANGE_NOTIFIER_H_ 69 #endif // NET_QUIC_CHROMIUM_MOCK_NETWORK_CHANGE_NOTIFIER_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/chromium/mock_network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698