| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "Document.h" | 9 #include "Document.h" |
| 10 #include "EventListener.h" | 10 #include "EventListener.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 this)); | 71 this)); |
| 72 dom_agent_impl_.set(new DomAgentImpl(dom_agent_delegate_stub_.get())); | 72 dom_agent_impl_.set(new DomAgentImpl(dom_agent_delegate_stub_.get())); |
| 73 | 73 |
| 74 // We are potentially attaching to the running page -> init agents with | 74 // We are potentially attaching to the running page -> init agents with |
| 75 // Document if any. | 75 // Document if any. |
| 76 Page* page = web_view_impl_->page(); | 76 Page* page = web_view_impl_->page(); |
| 77 Document* doc = page->mainFrame()->document(); | 77 Document* doc = page->mainFrame()->document(); |
| 78 if (doc) { | 78 if (doc) { |
| 79 // Reuse existing context in case detached/attached. | 79 // Reuse existing context in case detached/attached. |
| 80 if (utility_context_.IsEmpty()) { | 80 if (utility_context_.IsEmpty()) { |
| 81 debugger_agent_impl_->CreateUtilityContext(doc, &utility_context_); | 81 debugger_agent_impl_->ResetUtilityContext(doc, &utility_context_); |
| 82 } | 82 } |
| 83 dom_agent_impl_->SetDocument(doc); | 83 dom_agent_impl_->SetDocument(doc); |
| 84 net_agent_impl_->SetDocument(doc); | 84 net_agent_impl_->SetDocument(doc); |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Populate console. | 87 // Populate console. |
| 88 for (Vector<ConsoleMessage>::iterator it = console_log_.begin(); | 88 for (Vector<ConsoleMessage>::iterator it = console_log_.begin(); |
| 89 it != console_log_.end(); ++it) { | 89 it != console_log_.end(); ++it) { |
| 90 DictionaryValue message; | 90 DictionaryValue message; |
| 91 Serialize(*it, &message); | 91 Serialize(*it, &message); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 // We were attached prior to the page load -> init agents with Document. | 111 // We were attached prior to the page load -> init agents with Document. |
| 112 Document* doc; | 112 Document* doc; |
| 113 if (ready) { | 113 if (ready) { |
| 114 Page* page = web_view_impl_->page(); | 114 Page* page = web_view_impl_->page(); |
| 115 doc = page->mainFrame()->document(); | 115 doc = page->mainFrame()->document(); |
| 116 } else { | 116 } else { |
| 117 doc = NULL; | 117 doc = NULL; |
| 118 } | 118 } |
| 119 debugger_agent_impl_->CreateUtilityContext(doc, &utility_context_); | 119 debugger_agent_impl_->ResetUtilityContext(doc, &utility_context_); |
| 120 dom_agent_impl_->SetDocument(doc); | 120 dom_agent_impl_->SetDocument(doc); |
| 121 net_agent_impl_->SetDocument(doc); | 121 net_agent_impl_->SetDocument(doc); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void WebDevToolsAgentImpl::DidCommitLoadForFrame( | 124 void WebDevToolsAgentImpl::DidCommitLoadForFrame( |
| 125 WebViewImpl* webview, | 125 WebViewImpl* webview, |
| 126 WebFrame* frame, | 126 WebFrame* frame, |
| 127 bool is_new_navigation) { | 127 bool is_new_navigation) { |
| 128 if (webview->GetMainFrame() == frame) { | 128 if (webview->GetMainFrame() == frame) { |
| 129 net_agent_impl_->DidCommitMainResourceLoad(); | 129 net_agent_impl_->DidCommitMainResourceLoad(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 const std::string& command, | 271 const std::string& command, |
| 272 int caller_id) { | 272 int caller_id) { |
| 273 DebuggerAgentManager::ExecuteDebuggerCommand(command, caller_id); | 273 DebuggerAgentManager::ExecuteDebuggerCommand(command, caller_id); |
| 274 } | 274 } |
| 275 | 275 |
| 276 // static | 276 // static |
| 277 void WebDevToolsAgent::SetMessageLoopDispatchHandler( | 277 void WebDevToolsAgent::SetMessageLoopDispatchHandler( |
| 278 MessageLoopDispatchHandler handler) { | 278 MessageLoopDispatchHandler handler) { |
| 279 DebuggerAgentManager::SetMessageLoopDispatchHandler(handler); | 279 DebuggerAgentManager::SetMessageLoopDispatchHandler(handler); |
| 280 } | 280 } |
| OLD | NEW |