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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 return; | 127 return; |
129 if (RenderWidget* widget = frame_->GetRenderWidget()) { | 128 if (RenderWidget* widget = frame_->GetRenderWidget()) { |
130 widget->IgnoreAckForMouseMoveFromDebugger(); | 129 widget->IgnoreAckForMouseMoveFromDebugger(); |
131 paused_in_mouse_move_ = false; | 130 paused_in_mouse_move_ = false; |
132 } | 131 } |
133 } | 132 } |
134 | 133 |
135 void DevToolsAgent::enableTracing(const WebString& category_filter) { | 134 void DevToolsAgent::enableTracing(const WebString& category_filter) { |
136 TraceLog* trace_log = TraceLog::GetInstance(); | 135 TraceLog* trace_log = TraceLog::GetInstance(); |
137 trace_log->SetEnabled( | 136 trace_log->SetEnabled( |
138 base::trace_event::CategoryFilter(category_filter.utf8()), | 137 base::trace_event::TraceConfig(category_filter.utf8(), ""), |
139 TraceLog::RECORDING_MODE, TraceOptions()); | 138 TraceLog::RECORDING_MODE); |
140 } | 139 } |
141 | 140 |
142 void DevToolsAgent::disableTracing() { | 141 void DevToolsAgent::disableTracing() { |
143 TraceLog::GetInstance()->SetDisabled(); | 142 TraceLog::GetInstance()->SetDisabled(); |
144 } | 143 } |
145 | 144 |
146 // static | 145 // static |
147 DevToolsAgent* DevToolsAgent::FromRoutingId(int routing_id) { | 146 DevToolsAgent* DevToolsAgent::FromRoutingId(int routing_id) { |
148 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(routing_id); | 147 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(routing_id); |
149 if (it != g_agent_for_routing_id.Get().end()) { | 148 if (it != g_agent_for_routing_id.Get().end()) { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { | 271 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { |
273 WebLocalFrame* web_frame = frame_->GetWebFrame(); | 272 WebLocalFrame* web_frame = frame_->GetWebFrame(); |
274 return web_frame ? web_frame->devToolsAgent() : nullptr; | 273 return web_frame ? web_frame->devToolsAgent() : nullptr; |
275 } | 274 } |
276 | 275 |
277 bool DevToolsAgent::IsAttached() { | 276 bool DevToolsAgent::IsAttached() { |
278 return is_attached_; | 277 return is_attached_; |
279 } | 278 } |
280 | 279 |
281 } // namespace content | 280 } // namespace content |
OLD | NEW |