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/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
14 #include "net/server/http_server.h" | 14 #include "net/server/http_server.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 DevToolsBrowserTarget::DevToolsBrowserTarget( | 18 DevToolsBrowserTarget::DevToolsBrowserTarget(net::HttpServer* http_server, |
19 net::HttpServer* http_server, | 19 int connection_id) |
20 int connection_id) | |
21 : message_loop_proxy_(base::MessageLoopProxy::current()), | 20 : message_loop_proxy_(base::MessageLoopProxy::current()), |
22 http_server_(http_server), | 21 http_server_(http_server), |
23 connection_id_(connection_id), | 22 connection_id_(connection_id), |
24 weak_factory_(this) { | 23 weak_factory_(this) { |
25 } | 24 } |
26 | 25 |
27 void DevToolsBrowserTarget::RegisterDomainHandler( | 26 void DevToolsBrowserTarget::RegisterDomainHandler( |
28 const std::string& domain, | 27 const std::string& domain, |
29 DevToolsProtocol::Handler* handler, | 28 DevToolsProtocol::Handler* handler, |
30 bool handle_on_ui_thread) { | 29 bool handle_on_ui_thread) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 141 } |
143 | 142 |
144 void DevToolsBrowserTarget::RespondFromUIThread(const std::string& message) { | 143 void DevToolsBrowserTarget::RespondFromUIThread(const std::string& message) { |
145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
146 message_loop_proxy_->PostTask( | 145 message_loop_proxy_->PostTask( |
147 FROM_HERE, | 146 FROM_HERE, |
148 base::Bind(&DevToolsBrowserTarget::Respond, this, message)); | 147 base::Bind(&DevToolsBrowserTarget::Respond, this, message)); |
149 } | 148 } |
150 | 149 |
151 } // namespace content | 150 } // namespace content |
OLD | NEW |