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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/DOMWrapperMap.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 if (UNLIKELY(ContainsKey(key))) { 73 if (UNLIKELY(ContainsKey(key))) {
74 wrapper = NewLocal(isolate_, key); 74 wrapper = NewLocal(isolate_, key);
75 return false; 75 return false;
76 } 76 }
77 v8::Global<v8::Object> global(isolate_, wrapper); 77 v8::Global<v8::Object> global(isolate_, wrapper);
78 wrapper_type_info->ConfigureWrapper(&global); 78 wrapper_type_info->ConfigureWrapper(&global);
79 map_.Set(key, std::move(global)); 79 map_.Set(key, std::move(global));
80 return true; 80 return true;
81 } 81 }
82 82
83 void RemoveIfAny(KeyType* key) {
84 if (ContainsKey(key))
85 map_.Remove(key);
86 }
87
83 void Clear() { map_.Clear(); } 88 void Clear() { map_.Clear(); }
84 89
85 void RemoveAndDispose(KeyType* key) { 90 void RemoveAndDispose(KeyType* key) {
86 DCHECK(ContainsKey(key)); 91 DCHECK(ContainsKey(key));
87 map_.Remove(key); 92 map_.Remove(key);
88 } 93 }
89 94
90 void MarkWrapper(KeyType* object) { 95 void MarkWrapper(KeyType* object) {
91 map_.RegisterExternallyReferencedObject(object); 96 map_.RegisterExternallyReferencedObject(object);
92 } 97 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&); 162 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&);
158 }; 163 };
159 164
160 v8::Isolate* isolate_; 165 v8::Isolate* isolate_;
161 typename PersistentValueMapTraits::MapType map_; 166 typename PersistentValueMapTraits::MapType map_;
162 }; 167 };
163 168
164 } // namespace blink 169 } // namespace blink
165 170
166 #endif // DOMWrapperMap_h 171 #endif // DOMWrapperMap_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698