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

Side by Side Diff: content/browser/devtools/render_view_devtools_agent_host.cc

Issue 12431011: Avoid retaining the pointer to inspected WebContents in DevToolsWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 9 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
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | no next file » | 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) 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/render_view_devtools_agent_host.h" 5 #include "content/browser/devtools/render_view_devtools_agent_host.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "content/browser/child_process_security_policy_impl.h" 10 #include "content/browser/child_process_security_policy_impl.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 scoped_ptr<DevToolsProtocol::Response> overridden_response( 192 scoped_ptr<DevToolsProtocol::Response> overridden_response(
193 overrides_handler_->HandleCommand(command.get())); 193 overrides_handler_->HandleCommand(command.get()));
194 if (overridden_response) 194 if (overridden_response)
195 OnDispatchOnInspectorFrontend(overridden_response->Serialize()); 195 OnDispatchOnInspectorFrontend(overridden_response->Serialize());
196 else 196 else
197 DevToolsAgentHostImpl::DispatchOnInspectorBackend(message); 197 DevToolsAgentHostImpl::DispatchOnInspectorBackend(message);
198 } 198 }
199 199
200 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) { 200 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) {
201 if (!render_view_host_)
202 return;
201 msg->set_routing_id(render_view_host_->GetRoutingID()); 203 msg->set_routing_id(render_view_host_->GetRoutingID());
202 render_view_host_->Send(msg); 204 render_view_host_->Send(msg);
203 } 205 }
204 206
205 void RenderViewDevToolsAgentHost::NotifyClientAttaching() { 207 void RenderViewDevToolsAgentHost::NotifyClientAttaching() {
206 if (!render_view_host_) 208 if (!render_view_host_)
207 return; 209 return;
208 210
209 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadRawCookies( 211 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadRawCookies(
210 render_view_host_->GetProcess()->GetID()); 212 render_view_host_->GetProcess()->GetID());
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 snapshot_bounds)) 374 snapshot_bounds))
373 return false; 375 return false;
374 376
375 return base::Base64Encode(base::StringPiece( 377 return base::Base64Encode(base::StringPiece(
376 reinterpret_cast<char*>(&*png.begin()), 378 reinterpret_cast<char*>(&*png.begin()),
377 png.size()), 379 png.size()),
378 base_64_data); 380 base_64_data);
379 } 381 }
380 382
381 } // namespace content 383 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698