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