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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp

Issue 2773073002: [Bindings] Add DCHECK to confirm RemoteWindowProxy is not used for main frame (Closed)
Patch Set: 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 | « no previous file | 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 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 #include "platform/ScriptForbiddenScope.h" 40 #include "platform/ScriptForbiddenScope.h"
41 #include "platform/instrumentation/tracing/TraceEvent.h" 41 #include "platform/instrumentation/tracing/TraceEvent.h"
42 #include "v8/include/v8.h" 42 #include "v8/include/v8.h"
43 #include "wtf/Assertions.h" 43 #include "wtf/Assertions.h"
44 44
45 namespace blink { 45 namespace blink {
46 46
47 RemoteWindowProxy::RemoteWindowProxy(v8::Isolate* isolate, 47 RemoteWindowProxy::RemoteWindowProxy(v8::Isolate* isolate,
48 RemoteFrame& frame, 48 RemoteFrame& frame,
49 RefPtr<DOMWrapperWorld> world) 49 RefPtr<DOMWrapperWorld> world)
50 : WindowProxy(isolate, frame, std::move(world)) {} 50 : WindowProxy(isolate, frame, std::move(world)) {
51 DCHECK(!this->frame()->isMainFrame());
52 }
51 53
52 void RemoteWindowProxy::disposeContext(GlobalDetachmentBehavior behavior) { 54 void RemoteWindowProxy::disposeContext(GlobalDetachmentBehavior behavior) {
53 if (m_lifecycle != Lifecycle::ContextInitialized) 55 if (m_lifecycle != Lifecycle::ContextInitialized)
54 return; 56 return;
55 57
56 if (behavior == DetachGlobal && !m_globalProxy.isEmpty()) { 58 if (behavior == DetachGlobal && !m_globalProxy.isEmpty()) {
57 m_globalProxy.get().SetWrapperClassId(0); 59 m_globalProxy.get().SetWrapperClassId(0);
58 V8DOMWrapper::clearNativeInfo(isolate(), m_globalProxy.newLocal(isolate())); 60 V8DOMWrapper::clearNativeInfo(isolate(), m_globalProxy.newLocal(isolate()));
59 #if DCHECK_IS_ON() 61 #if DCHECK_IS_ON()
60 didDetachGlobalObject(); 62 didDetachGlobalObject();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 124
123 // The global object, aka window wrapper object. 125 // The global object, aka window wrapper object.
124 v8::Local<v8::Object> windowWrapper = 126 v8::Local<v8::Object> windowWrapper =
125 globalProxy->GetPrototype().As<v8::Object>(); 127 globalProxy->GetPrototype().As<v8::Object>();
126 v8::Local<v8::Object> associatedWrapper = 128 v8::Local<v8::Object> associatedWrapper =
127 associateWithWrapper(window, wrapperTypeInfo, windowWrapper); 129 associateWithWrapper(window, wrapperTypeInfo, windowWrapper);
128 DCHECK(associatedWrapper == windowWrapper); 130 DCHECK(associatedWrapper == windowWrapper);
129 } 131 }
130 132
131 } // namespace blink 133 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698