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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 Send(new DevToolsHostMsg_ClearBrowserCache(routing_id())); | 128 Send(new DevToolsHostMsg_ClearBrowserCache(routing_id())); |
129 } | 129 } |
130 | 130 |
131 void DevToolsAgent::clearBrowserCookies() { | 131 void DevToolsAgent::clearBrowserCookies() { |
132 Send(new DevToolsHostMsg_ClearBrowserCookies(routing_id())); | 132 Send(new DevToolsHostMsg_ClearBrowserCookies(routing_id())); |
133 } | 133 } |
134 | 134 |
135 void DevToolsAgent::setTraceEventCallback(TraceEventCallback cb) { | 135 void DevToolsAgent::setTraceEventCallback(TraceEventCallback cb) { |
136 TraceLog* trace_log = TraceLog::GetInstance(); | 136 TraceLog* trace_log = TraceLog::GetInstance(); |
137 trace_log->SetEventCallback(cb); | 137 trace_log->SetEventCallback(cb); |
138 trace_log->SetEnabled(!!cb, TraceLog::RECORD_UNTIL_FULL); | 138 if (!!cb) { |
| 139 trace_log->SetEnabled(base::debug::CategoryFilter( |
| 140 base::debug::CategoryFilter::kDefaultCategoryFilterString), |
| 141 TraceLog::RECORD_UNTIL_FULL); |
| 142 } else { |
| 143 trace_log->SetDisabled(); |
| 144 } |
139 } | 145 } |
140 | 146 |
141 #if defined(USE_TCMALLOC) && !defined(OS_WIN) | 147 #if defined(USE_TCMALLOC) && !defined(OS_WIN) |
142 static void AllocationVisitor(void* data, const void* ptr) { | 148 static void AllocationVisitor(void* data, const void* ptr) { |
143 typedef WebKit::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor; | 149 typedef WebKit::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor; |
144 Visitor* visitor = reinterpret_cast<Visitor*>(data); | 150 Visitor* visitor = reinterpret_cast<Visitor*>(data); |
145 visitor->visitObject(ptr); | 151 visitor->visitObject(ptr); |
146 } | 152 } |
147 #endif | 153 #endif |
148 | 154 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 if (!web_view) | 251 if (!web_view) |
246 return NULL; | 252 return NULL; |
247 return web_view->devToolsAgent(); | 253 return web_view->devToolsAgent(); |
248 } | 254 } |
249 | 255 |
250 bool DevToolsAgent::IsAttached() { | 256 bool DevToolsAgent::IsAttached() { |
251 return is_attached_; | 257 return is_attached_; |
252 } | 258 } |
253 | 259 |
254 } // namespace content | 260 } // namespace content |
OLD | NEW |