| 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 "Frame.h" | 7 #include "Frame.h" |
| 8 #include "PageGroupLoadDeferrer.h" | 8 #include "PageGroupLoadDeferrer.h" |
| 9 #include "V8Proxy.h" | 9 #include "V8Proxy.h" |
| 10 #include <wtf/HashSet.h> | 10 #include <wtf/HashSet.h> |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 204 } |
| 205 | 205 |
| 206 v8::Handle<v8::Context> context = message.GetEventContext(); | 206 v8::Handle<v8::Context> context = message.GetEventContext(); |
| 207 // If the context is from one of the inpected tabs it should have its context | 207 // If the context is from one of the inpected tabs it should have its context |
| 208 // data. | 208 // data. |
| 209 if (context.IsEmpty()) { | 209 if (context.IsEmpty()) { |
| 210 // Unknown context, skip the event. | 210 // Unknown context, skip the event. |
| 211 return; | 211 return; |
| 212 } | 212 } |
| 213 | 213 |
| 214 if (in_utility_context_) { | 214 if (in_utility_context_ && message.GetEvent() == v8::Break) { |
| 215 if (message.GetEvent() == v8::Break) { | 215 // This may happen when two tabs are being debugged in the same process. |
| 216 // This may happen when two tabs are being debugged in the same process. | 216 // Suppose that first debugger is pauesed on an exception. It will run |
| 217 // Suppose that first debugger is pauesed on an exception. It will run | 217 // nested MessageLoop which may process Break request from the second |
| 218 // nested MessageLoop which may process Break request from the second | 218 // debugger. |
| 219 // debugger. | 219 debug_break_delayed_ = true; |
| 220 debug_break_delayed_ = true; | |
| 221 } | |
| 222 } else { | 220 } else { |
| 223 // If the context is from one of the inpected tabs or injected extension | 221 // If the context is from one of the inpected tabs or injected extension |
| 224 // scripts it must have host_id in the data field. | 222 // scripts it must have host_id in the data field. |
| 225 int host_id = WebCore::V8Proxy::contextDebugId(context); | 223 int host_id = WebCore::V8Proxy::contextDebugId(context); |
| 226 if (host_id != -1) { | 224 if (host_id != -1) { |
| 227 DebuggerAgentImpl* agent = DebuggerAgentForHostId(host_id); | 225 DebuggerAgentImpl* agent = DebuggerAgentForHostId(host_id); |
| 228 if (agent) { | 226 if (agent) { |
| 229 agent->DebuggerOutput(out); | 227 agent->DebuggerOutput(out); |
| 230 return; | 228 return; |
| 231 } | 229 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 return NULL; | 311 return NULL; |
| 314 } | 312 } |
| 315 | 313 |
| 316 // static | 314 // static |
| 317 DebuggerAgentImpl* DebuggerAgentManager::DebuggerAgentForHostId(int host_id) { | 315 DebuggerAgentImpl* DebuggerAgentManager::DebuggerAgentForHostId(int host_id) { |
| 318 if (!attached_agents_map_) { | 316 if (!attached_agents_map_) { |
| 319 return NULL; | 317 return NULL; |
| 320 } | 318 } |
| 321 return attached_agents_map_->get(host_id); | 319 return attached_agents_map_->get(host_id); |
| 322 } | 320 } |
| OLD | NEW |