OLD | NEW |
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 #include "content/browser/media/media_internals_proxy.h" | 5 #include "content/browser/media/media_internals_proxy.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 NotificationService::AllBrowserContextsAndSources()); | 41 NotificationService::AllBrowserContextsAndSources()); |
42 } | 42 } |
43 | 43 |
44 void MediaInternalsProxy::Observe(int type, | 44 void MediaInternalsProxy::Observe(int type, |
45 const NotificationSource& source, | 45 const NotificationSource& source, |
46 const NotificationDetails& details) { | 46 const NotificationDetails& details) { |
47 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 47 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
48 DCHECK_EQ(type, NOTIFICATION_RENDERER_PROCESS_TERMINATED); | 48 DCHECK_EQ(type, NOTIFICATION_RENDERER_PROCESS_TERMINATED); |
49 RenderProcessHost* process = Source<RenderProcessHost>(source).ptr(); | 49 RenderProcessHost* process = Source<RenderProcessHost>(source).ptr(); |
50 CallJavaScriptFunctionOnUIThread("media.onRendererTerminated", | 50 CallJavaScriptFunctionOnUIThread("media.onRendererTerminated", |
51 new base::FundamentalValue(process->GetID())); | 51 new base::Value(process->GetID())); |
52 } | 52 } |
53 | 53 |
54 void MediaInternalsProxy::Attach(MediaInternalsMessageHandler* handler) { | 54 void MediaInternalsProxy::Attach(MediaInternalsMessageHandler* handler) { |
55 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 55 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
56 | 56 |
57 handler_ = handler; | 57 handler_ = handler; |
58 update_callback_ = base::Bind(&MediaInternalsProxy::UpdateUIOnUIThread, this); | 58 update_callback_ = base::Bind(&MediaInternalsProxy::UpdateUIOnUIThread, this); |
59 MediaInternals::GetInstance()->AddUpdateCallback(update_callback_); | 59 MediaInternals::GetInstance()->AddUpdateCallback(update_callback_); |
60 | 60 |
61 BrowserThread::PostTask( | 61 BrowserThread::PostTask( |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 const std::string& function, base::Value* args) { | 186 const std::string& function, base::Value* args) { |
187 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 187 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
188 std::unique_ptr<base::Value> args_value(args); | 188 std::unique_ptr<base::Value> args_value(args); |
189 std::vector<const base::Value*> args_vector; | 189 std::vector<const base::Value*> args_vector; |
190 args_vector.push_back(args_value.get()); | 190 args_vector.push_back(args_value.get()); |
191 base::string16 update = WebUI::GetJavascriptCall(function, args_vector); | 191 base::string16 update = WebUI::GetJavascriptCall(function, args_vector); |
192 UpdateUIOnUIThread(update); | 192 UpdateUIOnUIThread(update); |
193 } | 193 } |
194 | 194 |
195 } // namespace content | 195 } // namespace content |
OLD | NEW |