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

Side by Side Diff: chrome/browser/media/webrtc_internals.h

Issue 11876007: Connecting webrtc-internals WebUI frontend with the backend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@main
Patch Set: Created 7 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_ 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_INTERNALS_H_
6 #define CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_ 6 #define CHROME_BROWSER_MEDIA_WEBRTC_INTERNALS_H_
7 7
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/observer_list.h" 9 #include "base/observer_list.h"
10 #include "base/process.h" 10 #include "base/process.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "content/common/content_export.h" 12 #include "content/public/browser/webrtc_internals_interface.h"
13
14 struct PeerConnectionInfo;
15
16 namespace content {
17 13
18 class WebRTCInternalsUIObserver; 14 class WebRTCInternalsUIObserver;
19 15
20 // This is a singleton class running in the browser process. 16 // This is a singleton class running in the browser process.
21 // It collects peer connection infomation from the renderers, 17 // It collects peer connection infomation from the renderers,
22 // forwards the data to WebRTCInternalsUIObserver and 18 // forwards the data to WebRTCInternalsUIObserver and
23 // sends data collecting commands to the renderers. 19 // sends data collecting commands to the renderers.
24 class CONTENT_EXPORT WebRTCInternals { 20 class WebRTCInternals : public content::WebRTCInternalsInterface{
vrk (LEFT CHROMIUM) 2013/01/15 22:54:13 nit: space between "content::WebRTCInternalsInterf
jiayl 2013/01/15 23:03:31 Done.
25 public: 21 public:
26 static WebRTCInternals* GetInstance(); 22 static WebRTCInternals* GetInstance();
27 23
28 // Methods called when peer connection status changes. 24 // Methods called when peer connection status changes.
29 void AddPeerConnection(base::ProcessId pid, const PeerConnectionInfo& info); 25 virtual void AddPeerConnection(base::ProcessId pid,
30 void RemovePeerConnection(base::ProcessId pid, int lid); 26 int lid,
27 const std::string& url,
28 const std::string& servers,
29 const std::string& constraints) OVERRIDE;
30 virtual void RemovePeerConnection(base::ProcessId pid, int lid) OVERRIDE;
31 31
32 // Methods for adding or removing WebRTCInternalsUIObserver. 32 // Methods for adding or removing WebRTCInternalsUIObserver.
33 void AddObserver(WebRTCInternalsUIObserver *observer); 33 void AddObserver(WebRTCInternalsUIObserver *observer);
34 void RemoveObserver(WebRTCInternalsUIObserver *observer); 34 void RemoveObserver(WebRTCInternalsUIObserver *observer);
35 35
36 private: 36 private:
37 friend struct DefaultSingletonTraits<WebRTCInternals>; 37 friend struct DefaultSingletonTraits<WebRTCInternals>;
38 38
39 WebRTCInternals(); 39 WebRTCInternals();
40 virtual ~WebRTCInternals(); 40 virtual ~WebRTCInternals();
41 41
42 // Send updates to observers on UI thread. 42 // Send updates to observers on UI thread.
43 void SendUpdate(const std::string& command, base::Value* value); 43 void SendUpdate(const std::string& command, base::Value* value);
44 44
45 // Only the IO thread should access these fields. 45 // Only the IO thread should access these fields.
46 ObserverList<WebRTCInternalsUIObserver> observers_; 46 ObserverList<WebRTCInternalsUIObserver> observers_;
47 base::ListValue peer_connection_data_; 47 base::ListValue peer_connection_data_;
48 }; 48 };
49 49
50 } // namespace content 50 #endif // CHROME_BROWSER_MEDIA_WEBRTC_INTERNALS_H_
51
52 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698