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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.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, 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 v8::Local<v8::Object> associated_wrapper = 128 V8DOMWrapper::SetNativeInfo(GetIsolate(), global_proxy, wrapper_type_info,
129 AssociateWithWrapper(window, wrapper_type_info, global_proxy); 129 window);
130 DCHECK(associated_wrapper == global_proxy);
131 // Mark the handle to be traced by Oilpan, since the global proxy has a 130 // Mark the handle to be traced by Oilpan, since the global proxy has a
132 // reference to the DOMWindow. 131 // reference to the DOMWindow.
133 global_proxy_.Get().SetWrapperClassId(wrapper_type_info->wrapper_class_id); 132 global_proxy_.Get().SetWrapperClassId(wrapper_type_info->wrapper_class_id);
134 133
135 // The global object, aka window wrapper object. 134 // The global object, aka window wrapper object.
136 v8::Local<v8::Object> window_wrapper = 135 v8::Local<v8::Object> window_wrapper =
137 global_proxy->GetPrototype().As<v8::Object>(); 136 global_proxy->GetPrototype().As<v8::Object>();
138 V8DOMWrapper::SetNativeInfo(GetIsolate(), window_wrapper, wrapper_type_info, 137 v8::Local<v8::Object> associated_wrapper =
139 window); 138 AssociateWithWrapper(window, wrapper_type_info, window_wrapper);
139 DCHECK(associated_wrapper == window_wrapper);
140 } 140 }
141 141
142 } // namespace blink 142 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698