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

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

Issue 2848503002: Revert of binding: Changes the association among global-proxy/global/window-instance (2nd attempt).… (Closed)
Patch Set: Updated the test expectation. Created 3 years, 7 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 void LocalWindowProxy::SetupWindowPrototypeChain() { 214 void LocalWindowProxy::SetupWindowPrototypeChain() {
215 // Associate the window wrapper object and its prototype chain with the 215 // Associate the window wrapper object and its prototype chain with the
216 // corresponding native DOMWindow object. 216 // corresponding native DOMWindow object.
217 DOMWindow* window = GetFrame()->DomWindow(); 217 DOMWindow* window = GetFrame()->DomWindow();
218 const WrapperTypeInfo* wrapper_type_info = window->GetWrapperTypeInfo(); 218 const WrapperTypeInfo* wrapper_type_info = window->GetWrapperTypeInfo();
219 v8::Local<v8::Context> context = script_state_->GetContext(); 219 v8::Local<v8::Context> context = script_state_->GetContext();
220 220
221 // The global proxy object. Note this is not the global object. 221 // The global proxy object. Note this is not the global object.
222 v8::Local<v8::Object> global_proxy = context->Global(); 222 v8::Local<v8::Object> global_proxy = context->Global();
223 CHECK(global_proxy_ == global_proxy); 223 CHECK(global_proxy_ == global_proxy);
224 v8::Local<v8::Object> associated_wrapper = 224 V8DOMWrapper::SetNativeInfo(GetIsolate(), global_proxy, wrapper_type_info,
225 AssociateWithWrapper(window, wrapper_type_info, global_proxy); 225 window);
226 DCHECK(associated_wrapper == global_proxy);
227 // Mark the handle to be traced by Oilpan, since the global proxy has a 226 // Mark the handle to be traced by Oilpan, since the global proxy has a
228 // reference to the DOMWindow. 227 // reference to the DOMWindow.
229 global_proxy_.Get().SetWrapperClassId(wrapper_type_info->wrapper_class_id); 228 global_proxy_.Get().SetWrapperClassId(wrapper_type_info->wrapper_class_id);
230 229
231 // The global object, aka window wrapper object. 230 // The global object, aka window wrapper object.
232 v8::Local<v8::Object> window_wrapper = 231 v8::Local<v8::Object> window_wrapper =
233 global_proxy->GetPrototype().As<v8::Object>(); 232 global_proxy->GetPrototype().As<v8::Object>();
234 V8DOMWrapper::SetNativeInfo(GetIsolate(), window_wrapper, wrapper_type_info, 233 v8::Local<v8::Object> associated_wrapper =
235 window); 234 AssociateWithWrapper(window, wrapper_type_info, window_wrapper);
235 DCHECK(associated_wrapper == window_wrapper);
236 236
237 // The prototype object of Window interface. 237 // The prototype object of Window interface.
238 v8::Local<v8::Object> window_prototype = 238 v8::Local<v8::Object> window_prototype =
239 window_wrapper->GetPrototype().As<v8::Object>(); 239 window_wrapper->GetPrototype().As<v8::Object>();
240 CHECK(!window_prototype.IsEmpty()); 240 CHECK(!window_prototype.IsEmpty());
241 V8DOMWrapper::SetNativeInfo(GetIsolate(), window_prototype, wrapper_type_info, 241 V8DOMWrapper::SetNativeInfo(GetIsolate(), window_prototype, wrapper_type_info,
242 window); 242 window);
243 243
244 // The named properties object of Window interface. 244 // The named properties object of Window interface.
245 v8::Local<v8::Object> window_properties = 245 v8::Local<v8::Object> window_properties =
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 449
450 SetSecurityToken(origin); 450 SetSecurityToken(origin);
451 } 451 }
452 452
453 LocalWindowProxy::LocalWindowProxy(v8::Isolate* isolate, 453 LocalWindowProxy::LocalWindowProxy(v8::Isolate* isolate,
454 LocalFrame& frame, 454 LocalFrame& frame,
455 RefPtr<DOMWrapperWorld> world) 455 RefPtr<DOMWrapperWorld> world)
456 : WindowProxy(isolate, frame, std::move(world)) {} 456 : WindowProxy(isolate, frame, std::move(world)) {}
457 457
458 } // namespace blink 458 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/bindings.gni ('k') | third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698