| 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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 using blink::WebConsoleMessage; | 29 using blink::WebConsoleMessage; |
| 30 using blink::WebDevToolsAgent; | 30 using blink::WebDevToolsAgent; |
| 31 using blink::WebDevToolsAgentClient; | 31 using blink::WebDevToolsAgentClient; |
| 32 using blink::WebLocalFrame; | 32 using blink::WebLocalFrame; |
| 33 using blink::WebPoint; | 33 using blink::WebPoint; |
| 34 using blink::WebString; | 34 using blink::WebString; |
| 35 | 35 |
| 36 using base::trace_event::TraceLog; | 36 using base::trace_event::TraceLog; |
| 37 using base::trace_event::TraceOptions; | |
| 38 | 37 |
| 39 namespace content { | 38 namespace content { |
| 40 | 39 |
| 41 namespace { | 40 namespace { |
| 42 | 41 |
| 43 const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4; | 42 const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4; |
| 44 | 43 |
| 45 class WebKitClientMessageLoopImpl | 44 class WebKitClientMessageLoopImpl |
| 46 : public WebDevToolsAgentClient::WebKitClientMessageLoop { | 45 : public WebDevToolsAgentClient::WebKitClientMessageLoop { |
| 47 public: | 46 public: |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return; | 129 return; |
| 131 if (RenderWidget* widget = frame_->GetRenderWidget()) { | 130 if (RenderWidget* widget = frame_->GetRenderWidget()) { |
| 132 widget->IgnoreAckForMouseMoveFromDebugger(); | 131 widget->IgnoreAckForMouseMoveFromDebugger(); |
| 133 paused_in_mouse_move_ = false; | 132 paused_in_mouse_move_ = false; |
| 134 } | 133 } |
| 135 } | 134 } |
| 136 | 135 |
| 137 void DevToolsAgent::enableTracing(const WebString& category_filter) { | 136 void DevToolsAgent::enableTracing(const WebString& category_filter) { |
| 138 TraceLog* trace_log = TraceLog::GetInstance(); | 137 TraceLog* trace_log = TraceLog::GetInstance(); |
| 139 trace_log->SetEnabled( | 138 trace_log->SetEnabled( |
| 140 base::trace_event::CategoryFilter(category_filter.utf8()), | 139 base::trace_event::TraceConfig(category_filter.utf8(), ""), |
| 141 TraceLog::RECORDING_MODE, TraceOptions()); | 140 TraceLog::RECORDING_MODE); |
| 142 } | 141 } |
| 143 | 142 |
| 144 void DevToolsAgent::disableTracing() { | 143 void DevToolsAgent::disableTracing() { |
| 145 TraceLog::GetInstance()->SetDisabled(); | 144 TraceLog::GetInstance()->SetDisabled(); |
| 146 } | 145 } |
| 147 | 146 |
| 148 // static | 147 // static |
| 149 DevToolsAgent* DevToolsAgent::FromRoutingId(int routing_id) { | 148 DevToolsAgent* DevToolsAgent::FromRoutingId(int routing_id) { |
| 150 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(routing_id); | 149 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(routing_id); |
| 151 if (it != g_agent_for_routing_id.Get().end()) { | 150 if (it != g_agent_for_routing_id.Get().end()) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { | 272 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { |
| 274 WebLocalFrame* web_frame = frame_->GetWebFrame(); | 273 WebLocalFrame* web_frame = frame_->GetWebFrame(); |
| 275 return web_frame ? web_frame->devToolsAgent() : nullptr; | 274 return web_frame ? web_frame->devToolsAgent() : nullptr; |
| 276 } | 275 } |
| 277 | 276 |
| 278 bool DevToolsAgent::IsAttached() { | 277 bool DevToolsAgent::IsAttached() { |
| 279 return is_attached_; | 278 return is_attached_; |
| 280 } | 279 } |
| 281 | 280 |
| 282 } // namespace content | 281 } // namespace content |
| OLD | NEW |