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/devtools/devtools_browser_target.h" | 5 #include "content/browser/devtools/devtools_browser_target.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/message_loop/message_loop_proxy.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "net/server/http_server.h" | 16 #include "net/server/http_server.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 DevToolsBrowserTarget::DevToolsBrowserTarget( | 20 DevToolsBrowserTarget::DevToolsBrowserTarget(net::HttpServer* http_server, |
21 net::HttpServer* http_server, | 21 int connection_id) |
22 int connection_id) | |
23 : message_loop_proxy_(base::MessageLoopProxy::current()), | 22 : message_loop_proxy_(base::MessageLoopProxy::current()), |
24 http_server_(http_server), | 23 http_server_(http_server), |
25 connection_id_(connection_id), | 24 connection_id_(connection_id), |
26 weak_factory_(this) { | 25 weak_factory_(this) { |
27 } | 26 } |
28 | 27 |
29 void DevToolsBrowserTarget::RegisterDomainHandler( | 28 void DevToolsBrowserTarget::RegisterDomainHandler( |
30 const std::string& domain, | 29 const std::string& domain, |
31 DevToolsProtocol::Handler* handler, | 30 DevToolsProtocol::Handler* handler, |
32 bool handle_on_ui_thread) { | 31 bool handle_on_ui_thread) { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 170 } |
172 | 171 |
173 void DevToolsBrowserTarget::RespondFromUIThread(const std::string& message) { | 172 void DevToolsBrowserTarget::RespondFromUIThread(const std::string& message) { |
174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 173 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
175 message_loop_proxy_->PostTask( | 174 message_loop_proxy_->PostTask( |
176 FROM_HERE, | 175 FROM_HERE, |
177 base::Bind(&DevToolsBrowserTarget::Respond, this, message)); | 176 base::Bind(&DevToolsBrowserTarget::Respond, this, message)); |
178 } | 177 } |
179 | 178 |
180 } // namespace content | 179 } // namespace content |
OLD | NEW |