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

Side by Side Diff: content/browser/media/webrtc_internals_message_handler.cc

Issue 16915006: Convert most of extensions and some other random stuff to using the base namespace for Values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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 #include "content/browser/media/webrtc_internals_message_handler.h" 5 #include "content/browser/media/webrtc_internals_message_handler.h"
6 6
7 #include "content/browser/media/webrtc_internals.h" 7 #include "content/browser/media/webrtc_internals.h"
8 #include "content/common/media/peer_connection_tracker_messages.h" 8 #include "content/common/media/peer_connection_tracker_messages.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
11 #include "content/public/browser/render_view_host.h" 11 #include "content/public/browser/render_view_host.h"
12 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 #include "content/public/browser/web_ui.h" 13 #include "content/public/browser/web_ui.h"
14 14
15 using base::ListValue;
16
17 namespace content { 15 namespace content {
18 16
19 WebRTCInternalsMessageHandler::WebRTCInternalsMessageHandler() { 17 WebRTCInternalsMessageHandler::WebRTCInternalsMessageHandler() {
20 WebRTCInternals::GetInstance()->AddObserver(this); 18 WebRTCInternals::GetInstance()->AddObserver(this);
21 } 19 }
22 20
23 WebRTCInternalsMessageHandler::~WebRTCInternalsMessageHandler() { 21 WebRTCInternalsMessageHandler::~WebRTCInternalsMessageHandler() {
24 WebRTCInternals::GetInstance()->RemoveObserver(this); 22 WebRTCInternals::GetInstance()->RemoveObserver(this);
25 } 23 }
26 24
(...skipping 13 matching lines...) Expand all
40 web_ui()->RegisterMessageCallback("stopRtpRecording", 38 web_ui()->RegisterMessageCallback("stopRtpRecording",
41 base::Bind(&WebRTCInternalsMessageHandler::OnStopRtpRecording, 39 base::Bind(&WebRTCInternalsMessageHandler::OnStopRtpRecording,
42 base::Unretained(this))); 40 base::Unretained(this)));
43 } 41 }
44 42
45 void WebRTCInternalsMessageHandler::OnGetAllUpdates( 43 void WebRTCInternalsMessageHandler::OnGetAllUpdates(
46 const base::ListValue* list) { 44 const base::ListValue* list) {
47 WebRTCInternals::GetInstance()->SendAllUpdates(); 45 WebRTCInternals::GetInstance()->SendAllUpdates();
48 } 46 }
49 47
50 void WebRTCInternalsMessageHandler::OnGetAllStats(const ListValue* list) { 48 void WebRTCInternalsMessageHandler::OnGetAllStats(const base::ListValue* list) {
51 for (RenderProcessHost::iterator i( 49 for (RenderProcessHost::iterator i(
52 content::RenderProcessHost::AllHostsIterator()); 50 content::RenderProcessHost::AllHostsIterator());
53 !i.IsAtEnd(); i.Advance()) { 51 !i.IsAtEnd(); i.Advance()) {
54 i.GetCurrentValue()->Send(new PeerConnectionTracker_GetAllStats()); 52 i.GetCurrentValue()->Send(new PeerConnectionTracker_GetAllStats());
55 } 53 }
56 } 54 }
57 55
58 void WebRTCInternalsMessageHandler::OnStartRtpRecording( 56 void WebRTCInternalsMessageHandler::OnStartRtpRecording(
59 const base::ListValue* list) { 57 const base::ListValue* list) {
60 WebRTCInternals::GetInstance()->StartRtpRecording(); 58 WebRTCInternals::GetInstance()->StartRtpRecording();
61 } 59 }
62 60
63 void WebRTCInternalsMessageHandler::OnStopRtpRecording( 61 void WebRTCInternalsMessageHandler::OnStopRtpRecording(
64 const base::ListValue* list) { 62 const base::ListValue* list) {
65 WebRTCInternals::GetInstance()->StopRtpRecording(); 63 WebRTCInternals::GetInstance()->StopRtpRecording();
66 } 64 }
67 65
68 void WebRTCInternalsMessageHandler::OnUpdate(const std::string& command, 66 void WebRTCInternalsMessageHandler::OnUpdate(const std::string& command,
69 const base::Value* args) { 67 const base::Value* args) {
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 68 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
71 std::vector<const Value*> args_vector; 69 std::vector<const base::Value*> args_vector;
72 args_vector.push_back(args); 70 args_vector.push_back(args);
73 string16 update = WebUI::GetJavascriptCall(command, args_vector); 71 string16 update = WebUI::GetJavascriptCall(command, args_vector);
74 72
75 RenderViewHost* host = web_ui()->GetWebContents()->GetRenderViewHost(); 73 RenderViewHost* host = web_ui()->GetWebContents()->GetRenderViewHost();
76 if (host) 74 if (host)
77 host->ExecuteJavascriptInWebFrame(string16(), update); 75 host->ExecuteJavascriptInWebFrame(string16(), update);
78 } 76 }
79 77
80 } // namespace content 78 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698