| 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.h" | 10 #include "base/message_loop.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 void DevToolsAgent::clearBrowserCache() { | 124 void DevToolsAgent::clearBrowserCache() { |
| 125 Send(new DevToolsHostMsg_ClearBrowserCache(routing_id())); | 125 Send(new DevToolsHostMsg_ClearBrowserCache(routing_id())); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void DevToolsAgent::clearBrowserCookies() { | 128 void DevToolsAgent::clearBrowserCookies() { |
| 129 Send(new DevToolsHostMsg_ClearBrowserCookies(routing_id())); | 129 Send(new DevToolsHostMsg_ClearBrowserCookies(routing_id())); |
| 130 } | 130 } |
| 131 | 131 |
| 132 #if defined(USE_TCMALLOC) && !defined(OS_WIN) | 132 #if defined(USE_TCMALLOC) && !defined(OS_WIN) && !defined(USE_SYSTEM_TCMALLOC) |
| 133 static void AllocationVisitor(void* data, const void* ptr) { | 133 static void AllocationVisitor(void* data, const void* ptr) { |
| 134 typedef WebKit::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor; | 134 typedef WebKit::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor; |
| 135 Visitor* visitor = reinterpret_cast<Visitor*>(data); | 135 Visitor* visitor = reinterpret_cast<Visitor*>(data); |
| 136 visitor->visitObject(ptr); | 136 visitor->visitObject(ptr); |
| 137 } | 137 } |
| 138 #endif | 138 #endif |
| 139 | 139 |
| 140 void DevToolsAgent::visitAllocatedObjects(AllocatedObjectVisitor* visitor) { | 140 void DevToolsAgent::visitAllocatedObjects(AllocatedObjectVisitor* visitor) { |
| 141 #if defined(USE_TCMALLOC) && !defined(OS_WIN) | 141 #if defined(USE_TCMALLOC) && !defined(OS_WIN) && !defined(USE_SYSTEM_TCMALLOC) |
| 142 IterateAllocatedObjects(&AllocationVisitor, visitor); | 142 IterateAllocatedObjects(&AllocationVisitor, visitor); |
| 143 #endif | 143 #endif |
| 144 } | 144 } |
| 145 | 145 |
| 146 // static | 146 // static |
| 147 DevToolsAgent* DevToolsAgent::FromHostId(int host_id) { | 147 DevToolsAgent* DevToolsAgent::FromHostId(int host_id) { |
| 148 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(host_id); | 148 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(host_id); |
| 149 if (it != g_agent_for_routing_id.Get().end()) { | 149 if (it != g_agent_for_routing_id.Get().end()) { |
| 150 return it->second; | 150 return it->second; |
| 151 } | 151 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 if (!web_view) | 236 if (!web_view) |
| 237 return NULL; | 237 return NULL; |
| 238 return web_view->devToolsAgent(); | 238 return web_view->devToolsAgent(); |
| 239 } | 239 } |
| 240 | 240 |
| 241 bool DevToolsAgent::IsAttached() { | 241 bool DevToolsAgent::IsAttached() { |
| 242 return is_attached_; | 242 return is_attached_; |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace content | 245 } // namespace content |
| OLD | NEW |