Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: content/renderer/devtools_agent_filter.cc

Issue 8635005: DevTools: remove support for legacy remote debugger (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests compilation Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/devtools_agent_filter.h ('k') | content/renderer/devtools_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "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"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 virtual WebString message() { return WebString::fromUTF8(msg); } 32 virtual WebString message() { return WebString::fromUTF8(msg); }
33 private: 33 private:
34 std::string msg; 34 std::string msg;
35 int host_id; 35 int host_id;
36 }; 36 };
37 37
38 } 38 }
39 39
40 // static 40 // static
41 void DevToolsAgentFilter::DispatchMessageLoop() {
42 MessageLoop* current = MessageLoop::current();
43 bool old_state = current->NestableTasksAllowed();
44 current->SetNestableTasksAllowed(true);
45 current->RunAllPending();
46 current->SetNestableTasksAllowed(old_state);
47 }
48
49 // static
50 IPC::Channel* DevToolsAgentFilter::channel_ = NULL; 41 IPC::Channel* DevToolsAgentFilter::channel_ = NULL;
51 // static 42 // static
52 int DevToolsAgentFilter::current_routing_id_ = 0; 43 int DevToolsAgentFilter::current_routing_id_ = 0;
53 44
54 DevToolsAgentFilter::DevToolsAgentFilter() 45 DevToolsAgentFilter::DevToolsAgentFilter()
55 : message_handled_(false), 46 : message_handled_(false),
56 render_thread_loop_(MessageLoop::current()) { 47 render_thread_loop_(MessageLoop::current()) {
57 WebDevToolsAgent::setMessageLoopDispatchHandler(
58 &DevToolsAgentFilter::DispatchMessageLoop);
59 } 48 }
60 49
61 DevToolsAgentFilter::~DevToolsAgentFilter() { 50 DevToolsAgentFilter::~DevToolsAgentFilter() {
62 } 51 }
63 52
64 bool DevToolsAgentFilter::OnMessageReceived(const IPC::Message& message) { 53 bool DevToolsAgentFilter::OnMessageReceived(const IPC::Message& message) {
65 // Dispatch debugger commands directly from IO. 54 // Dispatch debugger commands directly from IO.
66 message_handled_ = true; 55 message_handled_ = true;
67 current_routing_id_ = message.routing_id(); 56 current_routing_id_ = message.routing_id();
68 IPC_BEGIN_MESSAGE_MAP(DevToolsAgentFilter, message) 57 IPC_BEGIN_MESSAGE_MAP(DevToolsAgentFilter, message)
69 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DebuggerCommand, OnDebuggerCommand)
70 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend, 58 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend,
71 OnDispatchOnInspectorBackend) 59 OnDispatchOnInspectorBackend)
72 IPC_MESSAGE_UNHANDLED(message_handled_ = false) 60 IPC_MESSAGE_UNHANDLED(message_handled_ = false)
73 IPC_END_MESSAGE_MAP() 61 IPC_END_MESSAGE_MAP()
74 return message_handled_; 62 return message_handled_;
75 } 63 }
76 64
77 void DevToolsAgentFilter::OnFilterAdded(IPC::Channel* channel) { 65 void DevToolsAgentFilter::OnFilterAdded(IPC::Channel* channel) {
78 channel_ = channel; 66 channel_ = channel;
79 } 67 }
80 68
81 void DevToolsAgentFilter::OnDebuggerCommand(const std::string& command) {
82 WebDevToolsAgent::executeDebuggerCommand(
83 WebString::fromUTF8(command), current_routing_id_);
84 }
85
86 void DevToolsAgentFilter::OnDispatchOnInspectorBackend( 69 void DevToolsAgentFilter::OnDispatchOnInspectorBackend(
87 const std::string& message) { 70 const std::string& message) {
88 if (!WebDevToolsAgent::shouldInterruptForMessage( 71 if (!WebDevToolsAgent::shouldInterruptForMessage(
89 WebString::fromUTF8(message))) { 72 WebString::fromUTF8(message))) {
90 message_handled_ = false; 73 message_handled_ = false;
91 return; 74 return;
92 } 75 }
93 WebDevToolsAgent::interruptAndDispatch( 76 WebDevToolsAgent::interruptAndDispatch(
94 new MessageImpl(message, current_routing_id_)); 77 new MessageImpl(message, current_routing_id_));
95 78
96 render_thread_loop_->PostTask( 79 render_thread_loop_->PostTask(
97 FROM_HERE, base::Bind(&WebDevToolsAgent::processPendingMessages)); 80 FROM_HERE, base::Bind(&WebDevToolsAgent::processPendingMessages));
98 } 81 }
OLDNEW
« no previous file with comments | « content/renderer/devtools_agent_filter.h ('k') | content/renderer/devtools_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698