OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "web/WebRemoteFrameImpl.h" | 5 #include "web/WebRemoteFrameImpl.h" |
6 | 6 |
7 #include "bindings/core/v8/RemoteWindowProxy.h" | 7 #include "bindings/core/v8/RemoteWindowProxy.h" |
8 #include "bindings/core/v8/V8Window.h" | |
9 #include "core/dom/Fullscreen.h" | 8 #include "core/dom/Fullscreen.h" |
10 #include "core/dom/RemoteSecurityContext.h" | 9 #include "core/dom/RemoteSecurityContext.h" |
11 #include "core/dom/SecurityContext.h" | 10 #include "core/dom/SecurityContext.h" |
12 #include "core/frame/FrameView.h" | 11 #include "core/frame/FrameView.h" |
13 #include "core/frame/Settings.h" | 12 #include "core/frame/Settings.h" |
14 #include "core/frame/csp/ContentSecurityPolicy.h" | 13 #include "core/frame/csp/ContentSecurityPolicy.h" |
15 #include "core/html/HTMLFrameOwnerElement.h" | 14 #include "core/html/HTMLFrameOwnerElement.h" |
16 #include "core/layout/LayoutObject.h" | 15 #include "core/layout/LayoutObject.h" |
17 #include "core/page/Page.h" | 16 #include "core/page/Page.h" |
18 #include "platform/heap/Handle.h" | 17 #include "platform/heap/Handle.h" |
19 #include "public/platform/WebFloatRect.h" | 18 #include "public/platform/WebFloatRect.h" |
20 #include "public/platform/WebRect.h" | 19 #include "public/platform/WebRect.h" |
21 #include "public/web/WebDocument.h" | 20 #include "public/web/WebDocument.h" |
22 #include "public/web/WebFrameOwnerProperties.h" | 21 #include "public/web/WebFrameOwnerProperties.h" |
23 #include "public/web/WebPerformance.h" | 22 #include "public/web/WebPerformance.h" |
24 #include "public/web/WebRange.h" | 23 #include "public/web/WebRange.h" |
25 #include "public/web/WebTreeScopeType.h" | 24 #include "public/web/WebTreeScopeType.h" |
26 #include "v8/include/v8.h" | 25 #include "v8/include/v8.h" |
27 #include "web/RemoteFrameOwner.h" | 26 #include "web/RemoteFrameOwner.h" |
28 #include "web/WebLocalFrameImpl.h" | 27 #include "web/WebLocalFrameImpl.h" |
29 #include "web/WebViewImpl.h" | 28 #include "web/WebViewImpl.h" |
30 #include "wtf/debug/Alias.h" | |
31 | 29 |
32 namespace blink { | 30 namespace blink { |
33 | 31 |
34 WebRemoteFrame* WebRemoteFrame::create(WebTreeScopeType scope, | 32 WebRemoteFrame* WebRemoteFrame::create(WebTreeScopeType scope, |
35 WebRemoteFrameClient* client, | 33 WebRemoteFrameClient* client, |
36 WebFrame* opener) { | 34 WebFrame* opener) { |
37 return WebRemoteFrameImpl::create(scope, client, opener); | 35 return WebRemoteFrameImpl::create(scope, client, opener); |
38 } | 36 } |
39 | 37 |
40 WebRemoteFrameImpl* WebRemoteFrameImpl::create(WebTreeScopeType scope, | 38 WebRemoteFrameImpl* WebRemoteFrameImpl::create(WebTreeScopeType scope, |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 return v8::Local<v8::Value>(); | 208 return v8::Local<v8::Value>(); |
211 } | 209 } |
212 | 210 |
213 v8::Local<v8::Context> WebRemoteFrameImpl::mainWorldScriptContext() const { | 211 v8::Local<v8::Context> WebRemoteFrameImpl::mainWorldScriptContext() const { |
214 NOTREACHED(); | 212 NOTREACHED(); |
215 return v8::Local<v8::Context>(); | 213 return v8::Local<v8::Context>(); |
216 } | 214 } |
217 | 215 |
218 v8::Local<v8::Context> WebRemoteFrameImpl::deprecatedMainWorldScriptContext() | 216 v8::Local<v8::Context> WebRemoteFrameImpl::deprecatedMainWorldScriptContext() |
219 const { | 217 const { |
220 v8::Local<v8::Context> context = | 218 return static_cast<RemoteWindowProxy*>( |
221 static_cast<RemoteWindowProxy*>( | 219 frame()->windowProxy(DOMWrapperWorld::mainWorld())) |
222 frame()->windowProxy(DOMWrapperWorld::mainWorld())) | 220 ->contextIfInitialized(); |
223 ->contextIfInitialized(); | |
224 | |
225 DOMWindow* window = frame()->domWindow(); | |
226 // Prevent this local from getting optimized out, and hopefully, the heap | |
227 // contents captured into minidumps. | |
228 WTF::debug::alias(&window); | |
229 | |
230 v8::Local<v8::Object> globalProxy = context->Global(); | |
231 CHECK(!globalProxy.IsEmpty()); | |
232 CHECK(V8Window::hasInstance(globalProxy, v8::Isolate::GetCurrent())); | |
233 CHECK(window); | |
234 CHECK_EQ(window, V8Window::toImpl(globalProxy)); | |
235 | |
236 return context; | |
237 } | 221 } |
238 | 222 |
239 void WebRemoteFrameImpl::reload(WebFrameLoadType) { | 223 void WebRemoteFrameImpl::reload(WebFrameLoadType) { |
240 NOTREACHED(); | 224 NOTREACHED(); |
241 } | 225 } |
242 | 226 |
243 void WebRemoteFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, | 227 void WebRemoteFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, |
244 WebFrameLoadType) { | 228 WebFrameLoadType) { |
245 NOTREACHED(); | 229 NOTREACHED(); |
246 } | 230 } |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 } | 530 } |
547 | 531 |
548 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, | 532 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, |
549 WebRemoteFrameClient* client) | 533 WebRemoteFrameClient* client) |
550 : WebRemoteFrame(scope), | 534 : WebRemoteFrame(scope), |
551 m_frameClient(RemoteFrameClientImpl::create(this)), | 535 m_frameClient(RemoteFrameClientImpl::create(this)), |
552 m_client(client), | 536 m_client(client), |
553 m_selfKeepAlive(this) {} | 537 m_selfKeepAlive(this) {} |
554 | 538 |
555 } // namespace blink | 539 } // namespace blink |
OLD | NEW |