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

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

Issue 2693893007: binding: Changes the association among global-proxy/global/window-instance (2nd attempt). (Closed)
Patch Set: Fixed a typo in DOMWrapperWorld::DissociateDOMWindowWrappersInAllWorlds. Created 3 years, 8 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
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 119
120 void RemoteWindowProxy::SetupWindowPrototypeChain() { 120 void RemoteWindowProxy::SetupWindowPrototypeChain() {
121 // Associate the window wrapper object and its prototype chain with the 121 // Associate the window wrapper object and its prototype chain with the
122 // corresponding native DOMWindow object. 122 // corresponding native DOMWindow object.
123 DOMWindow* window = GetFrame()->DomWindow(); 123 DOMWindow* window = GetFrame()->DomWindow();
124 const WrapperTypeInfo* wrapper_type_info = window->GetWrapperTypeInfo(); 124 const WrapperTypeInfo* wrapper_type_info = window->GetWrapperTypeInfo();
125 125
126 // The global proxy object. Note this is not the global object. 126 // The global proxy object. Note this is not the global object.
127 v8::Local<v8::Object> global_proxy = global_proxy_.NewLocal(GetIsolate()); 127 v8::Local<v8::Object> global_proxy = global_proxy_.NewLocal(GetIsolate());
128 CHECK(global_proxy_ == global_proxy); 128 v8::Local<v8::Object> associated_wrapper =
129 V8DOMWrapper::SetNativeInfo(GetIsolate(), global_proxy, wrapper_type_info, 129 AssociateWithWrapper(window, wrapper_type_info, global_proxy);
130 window); 130 DCHECK(associated_wrapper == global_proxy);
131 // Mark the handle to be traced by Oilpan, since the global proxy has a 131 // Mark the handle to be traced by Oilpan, since the global proxy has a
132 // reference to the DOMWindow. 132 // reference to the DOMWindow.
133 global_proxy_.Get().SetWrapperClassId(wrapper_type_info->wrapper_class_id); 133 global_proxy_.Get().SetWrapperClassId(wrapper_type_info->wrapper_class_id);
134 134
135 // The global object, aka window wrapper object. 135 // The global object, aka window wrapper object.
136 v8::Local<v8::Object> window_wrapper = 136 v8::Local<v8::Object> window_wrapper =
137 global_proxy->GetPrototype().As<v8::Object>(); 137 global_proxy->GetPrototype().As<v8::Object>();
138 v8::Local<v8::Object> associated_wrapper = 138 V8DOMWrapper::SetNativeInfo(GetIsolate(), window_wrapper, wrapper_type_info,
139 AssociateWithWrapper(window, wrapper_type_info, window_wrapper); 139 window);
140 DCHECK(associated_wrapper == window_wrapper);
141 } 140 }
142 141
143 } // namespace blink 142 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698