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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Set up the DOM window as the prototype of the new global object. | 100 // Set up the DOM window as the prototype of the new global object. |
101 v8::Handle<v8::Context> window_context = | 101 v8::Handle<v8::Context> window_context = |
102 V8Proxy::context(frame); | 102 V8Proxy::context(frame); |
103 v8::Handle<v8::Object> window_global = window_context->Global(); | 103 v8::Handle<v8::Object> window_global = window_context->Global(); |
104 v8::Handle<v8::Object> window_wrapper = | 104 v8::Handle<v8::Object> window_wrapper = |
105 V8DOMWrapper::lookupDOMWrapper(V8ClassIndex::DOMWINDOW, window_global); | 105 V8DOMWrapper::lookupDOMWrapper(V8ClassIndex::DOMWINDOW, window_global); |
106 | 106 |
107 ASSERT(V8DOMWrapper::convertDOMWrapperToNative<DOMWindow>(window_wrapper) == | 107 ASSERT(V8DOMWrapper::convertDOMWrapperToNative<DOMWindow>(window_wrapper) == |
108 frame->domWindow()); | 108 frame->domWindow()); |
109 | 109 |
110 // Create a new environment using an empty template for the shadow | 110 v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
111 // object. Reuse the global object if one has been created earlier. | |
112 v8::Handle<v8::ObjectTemplate> global_template = | |
113 V8DOMWindow::GetShadowObjectTemplate(); | |
114 | 111 |
115 // Install a security handler with V8. | 112 // Install a security handler with V8. |
116 global_template->SetAccessCheckCallbacks( | 113 global_template->SetAccessCheckCallbacks( |
117 V8Custom::v8DOMWindowNamedSecurityCheck, | 114 V8Custom::v8DOMWindowNamedSecurityCheck, |
118 V8Custom::v8DOMWindowIndexedSecurityCheck, | 115 V8Custom::v8DOMWindowIndexedSecurityCheck, |
119 v8::Integer::New(V8ClassIndex::DOMWINDOW)); | 116 v8::Integer::New(V8ClassIndex::DOMWINDOW)); |
120 | 117 |
121 *context = v8::Context::New( | 118 *context = v8::Context::New( |
122 NULL /* no extensions */, | 119 NULL /* no extensions */, |
123 global_template, | 120 global_template, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 ASSERT(function->IsFunction()); | 203 ASSERT(function->IsFunction()); |
207 v8::Handle<v8::Value> args[] = { | 204 v8::Handle<v8::Value> args[] = { |
208 v8::Local<v8::Value>() | 205 v8::Local<v8::Value>() |
209 }; | 206 }; |
210 v8::Handle<v8::Function>::Cast(function)->Call(context->Global(), 0, args); | 207 v8::Handle<v8::Function>::Cast(function)->Call(context->Global(), 0, args); |
211 } | 208 } |
212 | 209 |
213 WebCore::Page* DebuggerAgentImpl::GetPage() { | 210 WebCore::Page* DebuggerAgentImpl::GetPage() { |
214 return web_view_impl_->page(); | 211 return web_view_impl_->page(); |
215 } | 212 } |
OLD | NEW |