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

Side by Side Diff: content/browser/debugger/devtools_agent_host.cc

Issue 10837296: Fix a bug where the inspector would not keep event pages alive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yurys Created 8 years, 4 months 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
OLDNEW
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/debugger/devtools_agent_host.h" 5 #include "content/browser/debugger/devtools_agent_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "content/common/devtools_messages.h" 8 #include "content/common/devtools_messages.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 DevToolsAgentHost::DevToolsAgentHost() : close_listener_(NULL) { 12 DevToolsAgentHost::DevToolsAgentHost() : close_listener_(NULL) {
13 } 13 }
14 14
15 void DevToolsAgentHost::Attach() { 15 void DevToolsAgentHost::Attach() {
16 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE)); 16 SendMessageToAgent(new DevToolsAgentMsg_Attach(MSG_ROUTING_NONE));
17 NotifyClientAttaching();
17 } 18 }
18 19
19 void DevToolsAgentHost::Reattach(const std::string& saved_agent_state) { 20 void DevToolsAgentHost::Reattach(const std::string& saved_agent_state) {
20 SendMessageToAgent(new DevToolsAgentMsg_Reattach( 21 SendMessageToAgent(new DevToolsAgentMsg_Reattach(
21 MSG_ROUTING_NONE, 22 MSG_ROUTING_NONE,
22 saved_agent_state)); 23 saved_agent_state));
24 NotifyClientAttaching();
23 } 25 }
24 26
25 void DevToolsAgentHost::Detach() { 27 void DevToolsAgentHost::Detach() {
26 SendMessageToAgent(new DevToolsAgentMsg_Detach(MSG_ROUTING_NONE)); 28 SendMessageToAgent(new DevToolsAgentMsg_Detach(MSG_ROUTING_NONE));
29 NotifyClientDetaching();
27 } 30 }
28 31
29 void DevToolsAgentHost::DipatchOnInspectorBackend(const std::string& message) { 32 void DevToolsAgentHost::DipatchOnInspectorBackend(const std::string& message) {
30 SendMessageToAgent(new DevToolsAgentMsg_DispatchOnInspectorBackend( 33 SendMessageToAgent(new DevToolsAgentMsg_DispatchOnInspectorBackend(
31 MSG_ROUTING_NONE, message)); 34 MSG_ROUTING_NONE, message));
32 } 35 }
33 36
34 void DevToolsAgentHost::InspectElement(int x, int y) { 37 void DevToolsAgentHost::InspectElement(int x, int y) {
35 SendMessageToAgent(new DevToolsAgentMsg_InspectElement(MSG_ROUTING_NONE, 38 SendMessageToAgent(new DevToolsAgentMsg_InspectElement(MSG_ROUTING_NONE,
36 x, y)); 39 x, y));
37 } 40 }
38 41
39 void DevToolsAgentHost::AddMessageToConsole(ConsoleMessageLevel level, 42 void DevToolsAgentHost::AddMessageToConsole(ConsoleMessageLevel level,
40 const std::string& message) { 43 const std::string& message) {
41 SendMessageToAgent(new DevToolsAgentMsg_AddMessageToConsole( 44 SendMessageToAgent(new DevToolsAgentMsg_AddMessageToConsole(
42 MSG_ROUTING_NONE, 45 MSG_ROUTING_NONE,
43 level, 46 level,
44 message)); 47 message));
45 } 48 }
46 49
47 void DevToolsAgentHost::NotifyCloseListener() { 50 void DevToolsAgentHost::NotifyCloseListener() {
48 if (close_listener_) { 51 if (close_listener_) {
49 close_listener_->AgentHostClosing(this); 52 close_listener_->AgentHostClosing(this);
50 close_listener_ = NULL; 53 close_listener_ = NULL;
51 } 54 }
52 } 55 }
53 56
54 } // namespace content 57 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/debugger/devtools_agent_host.h ('k') | content/browser/debugger/devtools_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698