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 #include <wtf/RefPtr.h> | 8 #include <wtf/RefPtr.h> |
9 #include <wtf/Vector.h> | 9 #include <wtf/Vector.h> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 // static | 91 // static |
92 void DebuggerAgentImpl::ResetUtilityContext( | 92 void DebuggerAgentImpl::ResetUtilityContext( |
93 Document* document, | 93 Document* document, |
94 v8::Persistent<v8::Context>* context) { | 94 v8::Persistent<v8::Context>* context) { |
95 if (!context->IsEmpty()) { | 95 if (!context->IsEmpty()) { |
96 context->Dispose(); | 96 context->Dispose(); |
97 context->Clear(); | 97 context->Clear(); |
98 } | 98 } |
99 if (!document) { | |
100 return; | |
101 } | |
102 v8::HandleScope scope; | 99 v8::HandleScope scope; |
103 | 100 |
104 // TODO(pfeldman): Validate against Soeren. | 101 // TODO(pfeldman): Validate against Soeren. |
105 // Set up the DOM window as the prototype of the new global object. | 102 // Set up the DOM window as the prototype of the new global object. |
106 v8::Handle<v8::Context> window_context = | 103 v8::Handle<v8::Context> window_context = |
107 V8Proxy::context(document->frame()); | 104 V8Proxy::context(document->frame()); |
108 v8::Handle<v8::Object> window_global = window_context->Global(); | 105 v8::Handle<v8::Object> window_global = window_context->Global(); |
109 v8::Handle<v8::Value> window_wrapper = | 106 v8::Handle<v8::Value> window_wrapper = |
110 V8Proxy::lookupDOMWrapper(V8ClassIndex::DOMWINDOW, window_global); | 107 V8Proxy::lookupDOMWrapper(V8ClassIndex::DOMWINDOW, window_global); |
111 | 108 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 return ""; | 176 return ""; |
180 } else { | 177 } else { |
181 v8::Handle<v8::String> res_json = v8::Handle<v8::String>::Cast(res_obj); | 178 v8::Handle<v8::String> res_json = v8::Handle<v8::String>::Cast(res_obj); |
182 return WebCore::toWebCoreString(res_json); | 179 return WebCore::toWebCoreString(res_json); |
183 } | 180 } |
184 } | 181 } |
185 | 182 |
186 WebCore::Page* DebuggerAgentImpl::GetPage() { | 183 WebCore::Page* DebuggerAgentImpl::GetPage() { |
187 return web_view_impl_->page(); | 184 return web_view_impl_->page(); |
188 } | 185 } |
OLD | NEW |