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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "content/browser/media/media_internals_handler.h" | 9 #include "content/browser/media/media_internals_handler.h" |
10 #include "content/public/browser/content_browser_client.h" | 10 #include "content/public/browser/content_browser_client.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 if (GetContentClient()->browser()->GetNetLog()) { | 133 if (GetContentClient()->browser()->GetNetLog()) { |
134 net::NetLog* net_log = GetContentClient()->browser()->GetNetLog(); | 134 net::NetLog* net_log = GetContentClient()->browser()->GetNetLog(); |
135 net_log->DeprecatedRemoveObserver(this); | 135 net_log->DeprecatedRemoveObserver(this); |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 void MediaInternalsProxy::GetEverythingOnIOThread() { | 139 void MediaInternalsProxy::GetEverythingOnIOThread() { |
140 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 140 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
141 MediaInternals::GetInstance()->SendAudioStreamData(); | 141 MediaInternals::GetInstance()->SendAudioStreamData(); |
142 MediaInternals::GetInstance()->SendVideoCaptureDeviceCapabilities(); | 142 MediaInternals::GetInstance()->SendVideoCaptureDeviceCapabilities(); |
| 143 MediaInternals::GetInstance()->SendHistoricalMediaEvents(); |
143 } | 144 } |
144 | 145 |
145 void MediaInternalsProxy::UpdateUIOnUIThread(const base::string16& update) { | 146 void MediaInternalsProxy::UpdateUIOnUIThread(const base::string16& update) { |
146 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 147 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
147 // Don't forward updates to a destructed UI. | 148 // Don't forward updates to a destructed UI. |
148 if (handler_) | 149 if (handler_) |
149 handler_->OnUpdate(update); | 150 handler_->OnUpdate(update); |
150 } | 151 } |
151 | 152 |
152 void MediaInternalsProxy::AddNetEventOnUIThread(base::Value* entry) { | 153 void MediaInternalsProxy::AddNetEventOnUIThread(base::Value* entry) { |
(...skipping 22 matching lines...) Expand all Loading... |
175 const std::string& function, base::Value* args) { | 176 const std::string& function, base::Value* args) { |
176 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 177 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
177 scoped_ptr<base::Value> args_value(args); | 178 scoped_ptr<base::Value> args_value(args); |
178 std::vector<const base::Value*> args_vector; | 179 std::vector<const base::Value*> args_vector; |
179 args_vector.push_back(args_value.get()); | 180 args_vector.push_back(args_value.get()); |
180 base::string16 update = WebUI::GetJavascriptCall(function, args_vector); | 181 base::string16 update = WebUI::GetJavascriptCall(function, args_vector); |
181 UpdateUIOnUIThread(update); | 182 UpdateUIOnUIThread(update); |
182 } | 183 } |
183 | 184 |
184 } // namespace content | 185 } // namespace content |
OLD | NEW |