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

Side by Side Diff: content/renderer/p2p/empty_network_manager.h

Issue 1349823004: Check media permissions (mic/camera) before exposing local addresses to WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, fix test issue, fix windows build issue. Created 5 years, 2 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
OLDNEW
(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 #ifndef CONTENT_RENDERER_P2P_EMPTY_NETWORK_MANAGER_H_
6 #define CONTENT_RENDERER_P2P_EMPTY_NETWORK_MANAGER_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "base/threading/thread_checker.h"
10 #include "content/common/content_export.h"
11 #include "third_party/webrtc/base/network.h"
12
13 namespace content {
14
15 // A NetworkManager implementation which handles the case where local address
16 // enumeration is not requested and just returns empty network lists. This class
17 // is not thread safe and should only be used by WebRTC's worker thread.
18 class EmptyNetworkManager : public rtc::NetworkManagerBase {
19 public:
20 // This class is created by WebRTC's signaling thread but used by WebRTC's
21 // worker thread |task_runner|.
22 CONTENT_EXPORT EmptyNetworkManager();
23 CONTENT_EXPORT ~EmptyNetworkManager() override;
24
25 // rtc::NetworkManager:
26 void StartUpdating() override;
27 void StopUpdating() override;
28 void GetNetworks(NetworkList* networks) const override;
29
30 private:
31 void FireEvent();
32 void SendNetworksChangedSignal();
33
34 base::ThreadChecker thread_checker_;
35
36 // Track whether StartUpdating() has been called before.
37 bool updating_started_ = false;
38
39 base::WeakPtrFactory<EmptyNetworkManager> weak_ptr_factory_;
40
41 DISALLOW_COPY_AND_ASSIGN(EmptyNetworkManager);
42 };
43
44 } // namespace content
45
46 #endif // CONTENT_RENDERER_P2P_EMPTY_NETWORK_MANAGER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc/peer_connection_dependency_factory.cc ('k') | content/renderer/p2p/empty_network_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698