OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/webui/media/media_internals_proxy.h" | 5 #include "chrome/browser/ui/webui/media/media_internals_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/io_thread.h" | 9 #include "chrome/browser/io_thread.h" |
10 #include "chrome/browser/media/media_internals.h" | 10 #include "chrome/browser/media/media_internals.h" |
11 #include "chrome/browser/ui/webui/media/media_internals_handler.h" | 11 #include "chrome/browser/ui/webui/media/media_internals_handler.h" |
12 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
13 #include "content/browser/renderer_host/render_process_host.h" | 13 #include "content/browser/renderer_host/render_process_host.h" |
14 #include "content/public/browser/notification_types.h" | 14 #include "content/public/browser/notification_types.h" |
15 | 15 |
| 16 using content::BrowserThread; |
| 17 |
16 static const int kMediaInternalsProxyEventDelayMilliseconds = 100; | 18 static const int kMediaInternalsProxyEventDelayMilliseconds = 100; |
17 | 19 |
18 static const net::NetLog::EventType kNetEventTypeFilter[] = { | 20 static const net::NetLog::EventType kNetEventTypeFilter[] = { |
19 net::NetLog::TYPE_DISK_CACHE_ENTRY_IMPL, | 21 net::NetLog::TYPE_DISK_CACHE_ENTRY_IMPL, |
20 net::NetLog::TYPE_SPARSE_READ, | 22 net::NetLog::TYPE_SPARSE_READ, |
21 net::NetLog::TYPE_SPARSE_WRITE, | 23 net::NetLog::TYPE_SPARSE_WRITE, |
22 net::NetLog::TYPE_URL_REQUEST_START_JOB, | 24 net::NetLog::TYPE_URL_REQUEST_START_JOB, |
23 net::NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS, | 25 net::NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS, |
24 }; | 26 }; |
25 | 27 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 180 |
179 void MediaInternalsProxy::CallJavaScriptFunctionOnUIThread( | 181 void MediaInternalsProxy::CallJavaScriptFunctionOnUIThread( |
180 const std::string& function, Value* args) { | 182 const std::string& function, Value* args) { |
181 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 183 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
182 scoped_ptr<Value> args_value(args); | 184 scoped_ptr<Value> args_value(args); |
183 std::vector<const Value*> args_vector; | 185 std::vector<const Value*> args_vector; |
184 args_vector.push_back(args_value.get()); | 186 args_vector.push_back(args_value.get()); |
185 string16 update = WebUI::GetJavascriptCall(function, args_vector); | 187 string16 update = WebUI::GetJavascriptCall(function, args_vector); |
186 UpdateUIOnUIThread(update); | 188 UpdateUIOnUIThread(update); |
187 } | 189 } |
OLD | NEW |