| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include <wtf/HashSet.h> | 7 #include <wtf/HashSet.h> |
| 8 #undef LOG | 8 #undef LOG |
| 9 | 9 |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // static | 29 // static |
| 30 DebuggerAgentManager::AttachedAgentsSet* | 30 DebuggerAgentManager::AttachedAgentsSet* |
| 31 DebuggerAgentManager::attached_agents_ = NULL; | 31 DebuggerAgentManager::attached_agents_ = NULL; |
| 32 | 32 |
| 33 // static | 33 // static |
| 34 void DebuggerAgentManager::DebugAttach(DebuggerAgentImpl* debugger_agent) { | 34 void DebuggerAgentManager::DebugAttach(DebuggerAgentImpl* debugger_agent) { |
| 35 #if USE(V8) | 35 #if USE(V8) |
| 36 if (!attached_agents_) { | 36 if (!attached_agents_) { |
| 37 attached_agents_ = new AttachedAgentsSet(); | 37 attached_agents_ = new AttachedAgentsSet(); |
| 38 v8::Debug::SetMessageHandler(&DebuggerAgentManager::V8DebugMessageHandler); | 38 v8::Debug::SetMessageHandler( |
| 39 &DebuggerAgentManager::V8DebugMessageHandler, |
| 40 NULL, /* no additional data */ |
| 41 false /* don't create separate thread for sending debugger output */); |
| 39 } | 42 } |
| 40 attached_agents_->add(debugger_agent); | 43 attached_agents_->add(debugger_agent); |
| 41 #endif | 44 #endif |
| 42 } | 45 } |
| 43 | 46 |
| 44 // static | 47 // static |
| 45 void DebuggerAgentManager::DebugDetach(DebuggerAgentImpl* debugger_agent) { | 48 void DebuggerAgentManager::DebugDetach(DebuggerAgentImpl* debugger_agent) { |
| 46 #if USE(V8) | 49 #if USE(V8) |
| 47 if (!attached_agents_) { | 50 if (!attached_agents_) { |
| 48 NOTREACHED(); | 51 NOTREACHED(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // static | 90 // static |
| 88 DebuggerAgentImpl* DebuggerAgentManager::GetAgentForCurrentV8Context() { | 91 DebuggerAgentImpl* DebuggerAgentManager::GetAgentForCurrentV8Context() { |
| 89 if (!attached_agents_) { | 92 if (!attached_agents_) { |
| 90 return NULL; | 93 return NULL; |
| 91 } | 94 } |
| 92 DCHECK(!attached_agents_->isEmpty()); | 95 DCHECK(!attached_agents_->isEmpty()); |
| 93 // TODO(yurys): find agent for current v8 global context. Now we return first | 96 // TODO(yurys): find agent for current v8 global context. Now we return first |
| 94 // agent in the set. | 97 // agent in the set. |
| 95 return *attached_agents_->begin(); | 98 return *attached_agents_->begin(); |
| 96 } | 99 } |
| OLD | NEW |