| 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/renderer/devtools_agent_filter.h" | 5 #include "content/renderer/devtools_agent_filter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "content/common/devtools_messages.h" | 9 #include "content/common/devtools_messages.h" |
| 10 #include "content/renderer/devtools_agent.h" | 10 #include "content/renderer/devtools_agent.h" |
| 11 #include "content/renderer/plugin_channel_host.h" | 11 #include "content/renderer/plugin_channel_host.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 14 | 14 |
| 15 using WebKit::WebDevToolsAgent; | 15 using WebKit::WebDevToolsAgent; |
| 16 using WebKit::WebString; | 16 using WebKit::WebString; |
| 17 | 17 |
| 18 namespace content { |
| 19 |
| 18 namespace { | 20 namespace { |
| 19 | 21 |
| 20 class MessageImpl : public WebDevToolsAgent::MessageDescriptor { | 22 class MessageImpl : public WebDevToolsAgent::MessageDescriptor { |
| 21 public: | 23 public: |
| 22 MessageImpl(const std::string& message, int host_id) | 24 MessageImpl(const std::string& message, int host_id) |
| 23 : msg(message), | 25 : msg(message), |
| 24 host_id(host_id) { | 26 host_id(host_id) { |
| 25 } | 27 } |
| 26 virtual ~MessageImpl() {} | 28 virtual ~MessageImpl() {} |
| 27 virtual WebDevToolsAgent* agent() { | 29 virtual WebDevToolsAgent* agent() { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 WebString::fromUTF8(message))) { | 66 WebString::fromUTF8(message))) { |
| 65 message_handled_ = false; | 67 message_handled_ = false; |
| 66 return; | 68 return; |
| 67 } | 69 } |
| 68 WebDevToolsAgent::interruptAndDispatch( | 70 WebDevToolsAgent::interruptAndDispatch( |
| 69 new MessageImpl(message, current_routing_id_)); | 71 new MessageImpl(message, current_routing_id_)); |
| 70 | 72 |
| 71 render_thread_loop_->PostTask( | 73 render_thread_loop_->PostTask( |
| 72 FROM_HERE, base::Bind(&WebDevToolsAgent::processPendingMessages)); | 74 FROM_HERE, base::Bind(&WebDevToolsAgent::processPendingMessages)); |
| 73 } | 75 } |
| 76 |
| 77 } // namespace content |
| OLD | NEW |