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/renderer/devtools/devtools_agent.h" | 5 #include "content/renderer/devtools/devtools_agent.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 DevToolsAgent::DevToolsAgent(RenderViewImpl* render_view) | 76 DevToolsAgent::DevToolsAgent(RenderViewImpl* render_view) |
77 : RenderViewObserver(render_view), | 77 : RenderViewObserver(render_view), |
78 is_attached_(false), | 78 is_attached_(false), |
79 is_devtools_client_(false), | 79 is_devtools_client_(false), |
80 gpu_route_id_(MSG_ROUTING_NONE), | 80 gpu_route_id_(MSG_ROUTING_NONE), |
81 paused_in_mouse_move_(false) { | 81 paused_in_mouse_move_(false) { |
82 g_agent_for_routing_id.Get()[routing_id()] = this; | 82 g_agent_for_routing_id.Get()[routing_id()] = this; |
83 | 83 |
84 render_view->webview()->setDevToolsAgentClient(this); | 84 render_view->webview()->setDevToolsAgentClient(this); |
85 render_view->webview()->devToolsAgent()->setProcessId( | |
86 base::Process::Current().pid()); | |
87 } | 85 } |
88 | 86 |
89 DevToolsAgent::~DevToolsAgent() { | 87 DevToolsAgent::~DevToolsAgent() { |
90 g_agent_for_routing_id.Get().erase(routing_id()); | 88 g_agent_for_routing_id.Get().erase(routing_id()); |
91 resetTraceEventCallback(); | 89 resetTraceEventCallback(); |
92 } | 90 } |
93 | 91 |
94 // Called on the Renderer thread. | 92 // Called on the Renderer thread. |
95 bool DevToolsAgent::OnMessageReceived(const IPC::Message& message) { | 93 bool DevToolsAgent::OnMessageReceived(const IPC::Message& message) { |
96 bool handled = true; | 94 bool handled = true; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 if (!web_view) | 370 if (!web_view) |
373 return NULL; | 371 return NULL; |
374 return web_view->devToolsAgent(); | 372 return web_view->devToolsAgent(); |
375 } | 373 } |
376 | 374 |
377 bool DevToolsAgent::IsAttached() { | 375 bool DevToolsAgent::IsAttached() { |
378 return is_attached_; | 376 return is_attached_; |
379 } | 377 } |
380 | 378 |
381 } // namespace content | 379 } // namespace content |
OLD | NEW |