Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // A NetworkManager implementation which handles the case where local address | |
|
Sergey Ulanov
2015/09/24 19:37:28
nit: It's better to put this comment just above th
guoweis_left_chromium
2015/09/24 23:06:00
Done.
| |
| 6 // enumeration is not requested and just returns empty network lists. This class | |
| 7 // is not thread safe and should only be used by WebRTC's worker thread. | |
| 8 | |
| 9 #ifndef CONTENT_RENDERER_P2P_EMPTY_NETWORK_MANAGER_H_ | |
| 10 #define CONTENT_RENDERER_P2P_EMPTY_NETWORK_MANAGER_H_ | |
| 11 | |
| 12 #include "base/memory/weak_ptr.h" | |
| 13 #include "base/threading/thread_checker.h" | |
| 14 #include "base/time/time.h" | |
|
Sergey Ulanov
2015/09/24 19:37:28
don't need this
guoweis_left_chromium
2015/09/24 23:06:00
Done.
| |
| 15 #include "content/common/content_export.h" | |
| 16 #include "third_party/webrtc/base/network.h" | |
| 17 #include "third_party/webrtc/base/sigslot.h" | |
|
Sergey Ulanov
2015/09/24 19:37:28
don't need this
guoweis_left_chromium
2015/09/24 23:06:00
Done.
| |
| 18 #include "url/gurl.h" | |
|
Sergey Ulanov
2015/09/24 19:37:28
don't need this
guoweis_left_chromium
2015/09/24 23:06:00
Done.
| |
| 19 | |
| 20 namespace rtc { | |
| 21 class NetworkManager; | |
|
Sergey Ulanov
2015/09/24 19:37:28
don't need this - network.h is included above.
guoweis_left_chromium
2015/09/24 23:06:00
Done.
| |
| 22 } // namespace rtc | |
| 23 | |
| 24 namespace content { | |
| 25 | |
| 26 class CONTENT_EXPORT EmptyNetworkManager : public rtc::NetworkManagerBase { | |
| 27 public: | |
| 28 // This class is created by WebRTC's signaling thread but used by WebRTC's | |
| 29 // worker thread |task_runner|. | |
| 30 EmptyNetworkManager(); | |
| 31 ~EmptyNetworkManager() override; | |
| 32 | |
| 33 // rtc::NetworkManager: | |
| 34 void StartUpdating() override; | |
| 35 void StopUpdating() override; | |
| 36 void GetNetworks(NetworkList* networks) const override; | |
| 37 | |
| 38 private: | |
| 39 void FireEvent(); | |
| 40 void SendNetworksChangedSignal(); | |
| 41 | |
| 42 base::ThreadChecker thread_checker_; | |
| 43 | |
| 44 // Track whether StartUpdating() has been called before. | |
| 45 bool updating_started_ = false; | |
| 46 | |
| 47 base::WeakPtrFactory<EmptyNetworkManager> weak_ptr_factory_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(EmptyNetworkManager); | |
| 50 }; | |
| 51 | |
| 52 } // namespace content | |
| 53 | |
| 54 #endif // CONTENT_RENDERER_P2P_EMPTY_NETWORK_MANAGER_H_ | |
| OLD | NEW |