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 26 matching lines...) Expand all Loading... |
37 using blink::WebDevToolsAgent; | 37 using blink::WebDevToolsAgent; |
38 using blink::WebDevToolsAgentClient; | 38 using blink::WebDevToolsAgentClient; |
39 using blink::WebFrame; | 39 using blink::WebFrame; |
40 using blink::WebPoint; | 40 using blink::WebPoint; |
41 using blink::WebString; | 41 using blink::WebString; |
42 using blink::WebCString; | 42 using blink::WebCString; |
43 using blink::WebVector; | 43 using blink::WebVector; |
44 using blink::WebView; | 44 using blink::WebView; |
45 | 45 |
46 using base::debug::TraceLog; | 46 using base::debug::TraceLog; |
| 47 using base::debug::TraceOptions; |
47 | 48 |
48 namespace content { | 49 namespace content { |
49 | 50 |
50 base::subtle::AtomicWord DevToolsAgent::event_callback_; | 51 base::subtle::AtomicWord DevToolsAgent::event_callback_; |
51 | 52 |
52 namespace { | 53 namespace { |
53 | 54 |
54 class WebKitClientMessageLoopImpl | 55 class WebKitClientMessageLoopImpl |
55 : public WebDevToolsAgentClient::WebKitClientMessageLoop { | 56 : public WebDevToolsAgentClient::WebKitClientMessageLoop { |
56 public: | 57 public: |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 category_filter.utf8()), TraceEventCallbackWrapper); | 167 category_filter.utf8()), TraceEventCallbackWrapper); |
167 } else { | 168 } else { |
168 trace_log->SetEventCallbackDisabled(); | 169 trace_log->SetEventCallbackDisabled(); |
169 } | 170 } |
170 } | 171 } |
171 | 172 |
172 void DevToolsAgent::enableTracing(const WebString& category_filter) { | 173 void DevToolsAgent::enableTracing(const WebString& category_filter) { |
173 TraceLog* trace_log = TraceLog::GetInstance(); | 174 TraceLog* trace_log = TraceLog::GetInstance(); |
174 trace_log->SetEnabled(base::debug::CategoryFilter(category_filter.utf8()), | 175 trace_log->SetEnabled(base::debug::CategoryFilter(category_filter.utf8()), |
175 TraceLog::RECORDING_MODE, | 176 TraceLog::RECORDING_MODE, |
176 TraceLog::RECORD_UNTIL_FULL); | 177 TraceOptions()); |
177 } | 178 } |
178 | 179 |
179 void DevToolsAgent::disableTracing() { | 180 void DevToolsAgent::disableTracing() { |
180 TraceLog::GetInstance()->SetDisabled(); | 181 TraceLog::GetInstance()->SetDisabled(); |
181 } | 182 } |
182 | 183 |
183 // static | 184 // static |
184 void DevToolsAgent::TraceEventCallbackWrapper( | 185 void DevToolsAgent::TraceEventCallbackWrapper( |
185 base::TimeTicks timestamp, | 186 base::TimeTicks timestamp, |
186 char phase, | 187 char phase, |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 if (!web_view) | 375 if (!web_view) |
375 return NULL; | 376 return NULL; |
376 return web_view->devToolsAgent(); | 377 return web_view->devToolsAgent(); |
377 } | 378 } |
378 | 379 |
379 bool DevToolsAgent::IsAttached() { | 380 bool DevToolsAgent::IsAttached() { |
380 return is_attached_; | 381 return is_attached_; |
381 } | 382 } |
382 | 383 |
383 } // namespace content | 384 } // namespace content |
OLD | NEW |