| 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 "v8_proxy.h" | 9 #include "V8Proxy.h" |
| 10 #include <wtf/HashSet.h> | 10 #include <wtf/HashSet.h> |
| 11 #undef LOG | 11 #undef LOG |
| 12 | 12 |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "webkit/glue/devtools/debugger_agent_impl.h" | 14 #include "webkit/glue/devtools/debugger_agent_impl.h" |
| 15 #include "webkit/glue/devtools/debugger_agent_manager.h" | 15 #include "webkit/glue/devtools/debugger_agent_manager.h" |
| 16 #include "webkit/glue/webdevtoolsagent_impl.h" | 16 #include "webkit/glue/webdevtoolsagent_impl.h" |
| 17 #include "webkit/glue/webview_impl.h" | 17 #include "webkit/glue/webview_impl.h" |
| 18 | 18 |
| 19 #if USE(V8) | 19 #if USE(V8) |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 v8::Handle<v8::Context> context = message.GetEventContext(); | 181 v8::Handle<v8::Context> context = message.GetEventContext(); |
| 182 // If the context is from one of the inpected tabs it should have its context | 182 // If the context is from one of the inpected tabs it should have its context |
| 183 // data. | 183 // data. |
| 184 if (context.IsEmpty()) { | 184 if (context.IsEmpty()) { |
| 185 // Unknown context, skip the event. | 185 // Unknown context, skip the event. |
| 186 return; | 186 return; |
| 187 } | 187 } |
| 188 | 188 |
| 189 // If the context is from one of the inpected tabs or injected extension | 189 // If the context is from one of the inpected tabs or injected extension |
| 190 // scripts it must have host_id in the data field. | 190 // scripts it must have host_id in the data field. |
| 191 int host_id = WebCore::V8Proxy::GetContextDebugId(context); | 191 int host_id = WebCore::V8Proxy::contextDebugId(context); |
| 192 if (host_id != -1) { | 192 if (host_id != -1) { |
| 193 DebuggerAgentImpl* agent = DebuggerAgentForHostId(host_id); | 193 DebuggerAgentImpl* agent = DebuggerAgentForHostId(host_id); |
| 194 if (agent) { | 194 if (agent) { |
| 195 agent->DebuggerOutput(out); | 195 agent->DebuggerOutput(out); |
| 196 return; | 196 return; |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 | 199 |
| 200 if (!message.WillStartRunning()) { | 200 if (!message.WillStartRunning()) { |
| 201 // Autocontinue execution on break and exception events if there is no | 201 // Autocontinue execution on break and exception events if there is no |
| (...skipping 13 matching lines...) Expand all Loading... |
| 215 void DebuggerAgentManager::SetMessageLoopDispatchHandler( | 215 void DebuggerAgentManager::SetMessageLoopDispatchHandler( |
| 216 WebDevToolsAgent::MessageLoopDispatchHandler handler) { | 216 WebDevToolsAgent::MessageLoopDispatchHandler handler) { |
| 217 message_loop_dispatch_handler_ = handler; | 217 message_loop_dispatch_handler_ = handler; |
| 218 } | 218 } |
| 219 | 219 |
| 220 // static | 220 // static |
| 221 void DebuggerAgentManager::SetHostId(WebFrameImpl* webframe, int host_id) { | 221 void DebuggerAgentManager::SetHostId(WebFrameImpl* webframe, int host_id) { |
| 222 DCHECK(host_id > 0); | 222 DCHECK(host_id > 0); |
| 223 WebCore::V8Proxy* proxy = WebCore::V8Proxy::retrieve(webframe->frame()); | 223 WebCore::V8Proxy* proxy = WebCore::V8Proxy::retrieve(webframe->frame()); |
| 224 if (proxy) { | 224 if (proxy) { |
| 225 proxy->SetContextDebugId(host_id); | 225 proxy->setContextDebugId(host_id); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 // static | 229 // static |
| 230 void DebuggerAgentManager::OnWebViewClosed(WebViewImpl* webview) { | 230 void DebuggerAgentManager::OnWebViewClosed(WebViewImpl* webview) { |
| 231 if (page_deferrers_.contains(webview)) { | 231 if (page_deferrers_.contains(webview)) { |
| 232 delete page_deferrers_.get(webview); | 232 delete page_deferrers_.get(webview); |
| 233 page_deferrers_.remove(webview); | 233 page_deferrers_.remove(webview); |
| 234 } | 234 } |
| 235 } | 235 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 return NULL; | 271 return NULL; |
| 272 } | 272 } |
| 273 | 273 |
| 274 // static | 274 // static |
| 275 DebuggerAgentImpl* DebuggerAgentManager::DebuggerAgentForHostId(int host_id) { | 275 DebuggerAgentImpl* DebuggerAgentManager::DebuggerAgentForHostId(int host_id) { |
| 276 if (!attached_agents_map_) { | 276 if (!attached_agents_map_) { |
| 277 return NULL; | 277 return NULL; |
| 278 } | 278 } |
| 279 return attached_agents_map_->get(host_id); | 279 return attached_agents_map_->get(host_id); |
| 280 } | 280 } |
| OLD | NEW |