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

Side by Side Diff: content/browser/debugger/render_view_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: rm debug logs 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/render_view_devtools_agent_host.h" 5 #include "content/browser/debugger/render_view_devtools_agent_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "content/browser/debugger/devtools_manager_impl.h" 9 #include "content/browser/debugger/devtools_manager_impl.h"
10 #include "content/browser/debugger/render_view_devtools_agent_host.h" 10 #include "content/browser/debugger/render_view_devtools_agent_host.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return true; 70 return true;
71 } 71 }
72 return false; 72 return false;
73 } 73 }
74 74
75 RenderViewDevToolsAgentHost::RenderViewDevToolsAgentHost( 75 RenderViewDevToolsAgentHost::RenderViewDevToolsAgentHost(
76 RenderViewHost* rvh) 76 RenderViewHost* rvh)
77 : content::RenderViewHostObserver(rvh), 77 : content::RenderViewHostObserver(rvh),
78 render_view_host_(rvh) { 78 render_view_host_(rvh) {
79 g_instances.Get()[rvh] = this; 79 g_instances.Get()[rvh] = this;
80 }
80 81
81 // Notify that the view is being opened. This allows any views being debugged 82 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) {
82 // to do anything special they need to do to support debugging. 83 msg->set_routing_id(render_view_host_->GetRoutingID());
84 render_view_host_->Send(msg);
85 }
86
87 void RenderViewDevToolsAgentHost::NotifyClientOpening() {
83 content::NotificationService::current()->Notify( 88 content::NotificationService::current()->Notify(
84 content::NOTIFICATION_DEVTOOLS_WINDOW_OPENING, 89 content::NOTIFICATION_DEVTOOLS_WINDOW_OPENING,
85 content::Source<content::BrowserContext>( 90 content::Source<content::BrowserContext>(
86 render_view_host_->GetSiteInstance()->GetProcess()-> 91 render_view_host_->GetSiteInstance()->GetProcess()->
87 GetBrowserContext()), 92 GetBrowserContext()),
88 content::Details<RenderViewHost>(render_view_host_)); 93 content::Details<RenderViewHost>(render_view_host_));
89 } 94 }
90 95
91 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) {
92 msg->set_routing_id(render_view_host_->GetRoutingID());
93 render_view_host_->Send(msg);
94 }
95
96 void RenderViewDevToolsAgentHost::NotifyClientClosing() { 96 void RenderViewDevToolsAgentHost::NotifyClientClosing() {
97 content::NotificationService::current()->Notify( 97 content::NotificationService::current()->Notify(
98 content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING, 98 content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING,
99 content::Source<content::BrowserContext>( 99 content::Source<content::BrowserContext>(
100 render_view_host_->GetSiteInstance()->GetProcess()-> 100 render_view_host_->GetSiteInstance()->GetProcess()->
101 GetBrowserContext()), 101 GetBrowserContext()),
102 content::Details<RenderViewHost>(render_view_host_)); 102 content::Details<RenderViewHost>(render_view_host_));
103 } 103 }
104 104
105 int RenderViewDevToolsAgentHost::GetRenderProcessId() { 105 int RenderViewDevToolsAgentHost::GetRenderProcessId() {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 void RenderViewDevToolsAgentHost::OnClearBrowserCache() { 146 void RenderViewDevToolsAgentHost::OnClearBrowserCache() {
147 content::GetContentClient()->browser()->ClearCache(render_view_host_); 147 content::GetContentClient()->browser()->ClearCache(render_view_host_);
148 } 148 }
149 149
150 void RenderViewDevToolsAgentHost::OnClearBrowserCookies() { 150 void RenderViewDevToolsAgentHost::OnClearBrowserCookies() {
151 content::GetContentClient()->browser()->ClearCookies(render_view_host_); 151 content::GetContentClient()->browser()->ClearCookies(render_view_host_);
152 } 152 }
153 153
154 } // namespace content 154 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698