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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h

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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 DCHECK(!wrapper.IsEmpty()); 129 DCHECK(!wrapper.IsEmpty());
130 if (is_main_world_) 130 if (is_main_world_)
131 return object->SetWrapper(isolate, wrapper_type_info, wrapper); 131 return object->SetWrapper(isolate, wrapper_type_info, wrapper);
132 return wrapper_map_->Set(object, wrapper_type_info, wrapper); 132 return wrapper_map_->Set(object, wrapper_type_info, wrapper);
133 } 133 }
134 134
135 void MarkWrapper(ScriptWrappable* script_wrappable) { 135 void MarkWrapper(ScriptWrappable* script_wrappable) {
136 wrapper_map_->MarkWrapper(script_wrappable); 136 wrapper_map_->MarkWrapper(script_wrappable);
137 } 137 }
138 138
139 // Dissociates a wrapper, if any, from |script_wrappable|.
140 void UnsetWrapperIfAny(ScriptWrappable* script_wrappable) {
141 DCHECK(!is_main_world_);
142 wrapper_map_->RemoveIfAny(script_wrappable);
143 }
144
139 bool SetReturnValueFrom(v8::ReturnValue<v8::Value> return_value, 145 bool SetReturnValueFrom(v8::ReturnValue<v8::Value> return_value,
140 ScriptWrappable* object) { 146 ScriptWrappable* object) {
141 if (is_main_world_) 147 if (is_main_world_)
142 return object->SetReturnValue(return_value); 148 return object->SetReturnValue(return_value);
143 return wrapper_map_->SetReturnValueFrom(return_value, object); 149 return wrapper_map_->SetReturnValueFrom(return_value, object);
144 } 150 }
145 151
146 bool ContainsWrapper(ScriptWrappable* object) { 152 bool ContainsWrapper(ScriptWrappable* object) {
147 if (is_main_world_) 153 if (is_main_world_)
148 return object->ContainsWrapper(); 154 return object->ContainsWrapper();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 template <> 190 template <>
185 inline void 191 inline void
186 DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWeak( 192 DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWeak(
187 const v8::WeakCallbackInfo<WeakCallbackDataType>&) { 193 const v8::WeakCallbackInfo<WeakCallbackDataType>&) {
188 WrapperTypeInfo::WrapperDestroyed(); 194 WrapperTypeInfo::WrapperDestroyed();
189 } 195 }
190 196
191 } // namespace blink 197 } // namespace blink
192 198
193 #endif // DOMDataStore_h 199 #endif // DOMDataStore_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/bindings.gni ('k') | third_party/WebKit/Source/bindings/core/v8/DOMWrapperMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698