Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Side by Side Diff: third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp

Issue 2736533002: Add CHECKs to try to narrow down cause of bad internal fields in Window DOM wrapper (Closed)
Patch Set: "add missing HandleScope" Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
8 #include "core/dom/Fullscreen.h" 9 #include "core/dom/Fullscreen.h"
9 #include "core/dom/RemoteSecurityContext.h" 10 #include "core/dom/RemoteSecurityContext.h"
10 #include "core/dom/SecurityContext.h" 11 #include "core/dom/SecurityContext.h"
11 #include "core/frame/FrameView.h" 12 #include "core/frame/FrameView.h"
12 #include "core/frame/Settings.h" 13 #include "core/frame/Settings.h"
13 #include "core/frame/csp/ContentSecurityPolicy.h" 14 #include "core/frame/csp/ContentSecurityPolicy.h"
14 #include "core/html/HTMLFrameOwnerElement.h" 15 #include "core/html/HTMLFrameOwnerElement.h"
15 #include "core/layout/LayoutObject.h" 16 #include "core/layout/LayoutObject.h"
16 #include "core/page/Page.h" 17 #include "core/page/Page.h"
17 #include "platform/heap/Handle.h" 18 #include "platform/heap/Handle.h"
18 #include "public/platform/WebFloatRect.h" 19 #include "public/platform/WebFloatRect.h"
19 #include "public/platform/WebRect.h" 20 #include "public/platform/WebRect.h"
20 #include "public/web/WebDocument.h" 21 #include "public/web/WebDocument.h"
21 #include "public/web/WebFrameOwnerProperties.h" 22 #include "public/web/WebFrameOwnerProperties.h"
22 #include "public/web/WebPerformance.h" 23 #include "public/web/WebPerformance.h"
23 #include "public/web/WebRange.h" 24 #include "public/web/WebRange.h"
24 #include "public/web/WebTreeScopeType.h" 25 #include "public/web/WebTreeScopeType.h"
25 #include "v8/include/v8.h" 26 #include "v8/include/v8.h"
26 #include "web/RemoteFrameOwner.h" 27 #include "web/RemoteFrameOwner.h"
27 #include "web/WebLocalFrameImpl.h" 28 #include "web/WebLocalFrameImpl.h"
28 #include "web/WebViewImpl.h" 29 #include "web/WebViewImpl.h"
30 #include "wtf/debug/Alias.h"
29 31
30 namespace blink { 32 namespace blink {
31 33
32 WebRemoteFrame* WebRemoteFrame::create(WebTreeScopeType scope, 34 WebRemoteFrame* WebRemoteFrame::create(WebTreeScopeType scope,
33 WebRemoteFrameClient* client, 35 WebRemoteFrameClient* client,
34 WebFrame* opener) { 36 WebFrame* opener) {
35 return WebRemoteFrameImpl::create(scope, client, opener); 37 return WebRemoteFrameImpl::create(scope, client, opener);
36 } 38 }
37 39
38 WebRemoteFrameImpl* WebRemoteFrameImpl::create(WebTreeScopeType scope, 40 WebRemoteFrameImpl* WebRemoteFrameImpl::create(WebTreeScopeType scope,
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 return v8::Local<v8::Value>(); 210 return v8::Local<v8::Value>();
209 } 211 }
210 212
211 v8::Local<v8::Context> WebRemoteFrameImpl::mainWorldScriptContext() const { 213 v8::Local<v8::Context> WebRemoteFrameImpl::mainWorldScriptContext() const {
212 NOTREACHED(); 214 NOTREACHED();
213 return v8::Local<v8::Context>(); 215 return v8::Local<v8::Context>();
214 } 216 }
215 217
216 v8::Local<v8::Context> WebRemoteFrameImpl::deprecatedMainWorldScriptContext() 218 v8::Local<v8::Context> WebRemoteFrameImpl::deprecatedMainWorldScriptContext()
217 const { 219 const {
218 return static_cast<RemoteWindowProxy*>( 220 v8::Local<v8::Context> context =
219 frame()->windowProxy(DOMWrapperWorld::mainWorld())) 221 static_cast<RemoteWindowProxy*>(
220 ->contextIfInitialized(); 222 frame()->windowProxy(DOMWrapperWorld::mainWorld()))
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;
221 } 237 }
222 238
223 void WebRemoteFrameImpl::reload(WebFrameLoadType) { 239 void WebRemoteFrameImpl::reload(WebFrameLoadType) {
224 NOTREACHED(); 240 NOTREACHED();
225 } 241 }
226 242
227 void WebRemoteFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, 243 void WebRemoteFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl,
228 WebFrameLoadType) { 244 WebFrameLoadType) {
229 NOTREACHED(); 245 NOTREACHED();
230 } 246 }
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 } 546 }
531 547
532 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, 548 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope,
533 WebRemoteFrameClient* client) 549 WebRemoteFrameClient* client)
534 : WebRemoteFrame(scope), 550 : WebRemoteFrame(scope),
535 m_frameClient(RemoteFrameClientImpl::create(this)), 551 m_frameClient(RemoteFrameClientImpl::create(this)),
536 m_client(client), 552 m_client(client),
537 m_selfKeepAlive(this) {} 553 m_selfKeepAlive(this) {}
538 554
539 } // namespace blink 555 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698