| 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/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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 scoped_ptr<DevToolsProtocol::Response> overridden_response( | 160 scoped_ptr<DevToolsProtocol::Response> overridden_response( |
| 161 overrides_handler_->HandleCommand(command.get())); | 161 overrides_handler_->HandleCommand(command.get())); |
| 162 if (overridden_response) | 162 if (overridden_response) |
| 163 OnDispatchOnInspectorFrontend(overridden_response->Serialize()); | 163 OnDispatchOnInspectorFrontend(overridden_response->Serialize()); |
| 164 else | 164 else |
| 165 DevToolsAgentHostImpl::DispatchOnInspectorBackend(message); | 165 DevToolsAgentHostImpl::DispatchOnInspectorBackend(message); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) { | 168 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) { |
| 169 if (!render_view_host_) |
| 170 return; |
| 169 msg->set_routing_id(render_view_host_->GetRoutingID()); | 171 msg->set_routing_id(render_view_host_->GetRoutingID()); |
| 170 render_view_host_->Send(msg); | 172 render_view_host_->Send(msg); |
| 171 } | 173 } |
| 172 | 174 |
| 173 void RenderViewDevToolsAgentHost::NotifyClientAttaching() { | 175 void RenderViewDevToolsAgentHost::NotifyClientAttaching() { |
| 174 if (!render_view_host_) | 176 if (!render_view_host_) |
| 175 return; | 177 return; |
| 176 | 178 |
| 177 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadRawCookies( | 179 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadRawCookies( |
| 178 render_view_host_->GetProcess()->GetID()); | 180 render_view_host_->GetProcess()->GetID()); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 snapshot_bounds)) | 342 snapshot_bounds)) |
| 341 return false; | 343 return false; |
| 342 | 344 |
| 343 return base::Base64Encode(base::StringPiece( | 345 return base::Base64Encode(base::StringPiece( |
| 344 reinterpret_cast<char*>(&*png.begin()), | 346 reinterpret_cast<char*>(&*png.begin()), |
| 345 png.size()), | 347 png.size()), |
| 346 base_64_data); | 348 base_64_data); |
| 347 } | 349 } |
| 348 | 350 |
| 349 } // namespace content | 351 } // namespace content |
| OLD | NEW |