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

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

Issue 2021203002: Rename ScriptWrappable::newLocalWrapper to ScriptWrappable::mainWorldWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 static v8::Local<v8::Object> getWrapper(ScriptWrappable* object, v8::Isolate * isolate) 101 static v8::Local<v8::Object> getWrapper(ScriptWrappable* object, v8::Isolate * isolate)
102 { 102 {
103 return current(isolate).get(object, isolate); 103 return current(isolate).get(object, isolate);
104 } 104 }
105 105
106 static v8::Local<v8::Object> getWrapper(Node* node, v8::Isolate* isolate) 106 static v8::Local<v8::Object> getWrapper(Node* node, v8::Isolate* isolate)
107 { 107 {
108 if (canUseScriptWrappable(node)) 108 if (canUseScriptWrappable(node))
109 return ScriptWrappable::fromNode(node)->newLocalWrapper(isolate); 109 return ScriptWrappable::fromNode(node)->mainWorldWrapper(isolate);
110 return current(isolate).get(ScriptWrappable::fromNode(node), isolate); 110 return current(isolate).get(ScriptWrappable::fromNode(node), isolate);
111 } 111 }
112 112
113 static void setWrapperReference(const v8::Persistent<v8::Object>& parent, Sc riptWrappable* child, v8::Isolate* isolate) 113 static void setWrapperReference(const v8::Persistent<v8::Object>& parent, Sc riptWrappable* child, v8::Isolate* isolate)
114 { 114 {
115 current(isolate).setReference(parent, child, isolate); 115 current(isolate).setReference(parent, child, isolate);
116 } 116 }
117 117
118 static void setWrapperReference(const v8::Persistent<v8::Object>& parent, No de* child, v8::Isolate* isolate) 118 static void setWrapperReference(const v8::Persistent<v8::Object>& parent, No de* child, v8::Isolate* isolate)
119 { 119 {
(...skipping 22 matching lines...) Expand all
142 } 142 }
143 143
144 static bool containsWrapper(ScriptWrappable* object, v8::Isolate* isolate) 144 static bool containsWrapper(ScriptWrappable* object, v8::Isolate* isolate)
145 { 145 {
146 return current(isolate).containsWrapper(object); 146 return current(isolate).containsWrapper(object);
147 } 147 }
148 148
149 v8::Local<v8::Object> get(ScriptWrappable* object, v8::Isolate* isolate) 149 v8::Local<v8::Object> get(ScriptWrappable* object, v8::Isolate* isolate)
150 { 150 {
151 if (m_isMainWorld) 151 if (m_isMainWorld)
152 return object->newLocalWrapper(isolate); 152 return object->mainWorldWrapper(isolate);
153 return m_wrapperMap->newLocal(isolate, object); 153 return m_wrapperMap->newLocal(isolate, object);
154 } 154 }
155 155
156 void markWrapper(ScriptWrappable* scriptWrappable) 156 void markWrapper(ScriptWrappable* scriptWrappable)
157 { 157 {
158 m_wrapperMap->markWrapper(scriptWrappable); 158 m_wrapperMap->markWrapper(scriptWrappable);
159 } 159 }
160 160
161 void setReference(const v8::Persistent<v8::Object>& parent, ScriptWrappable* child, v8::Isolate* isolate) 161 void setReference(const v8::Persistent<v8::Object>& parent, ScriptWrappable* child, v8::Isolate* isolate)
162 { 162 {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 template<> 228 template<>
229 inline void DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWea k(const v8::WeakCallbackInfo<WeakCallbackDataType>& data) 229 inline void DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWea k(const v8::WeakCallbackInfo<WeakCallbackDataType>& data)
230 { 230 {
231 auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>(data.GetInternalFi eld(v8DOMWrapperTypeIndex)); 231 auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>(data.GetInternalFi eld(v8DOMWrapperTypeIndex));
232 wrapperTypeInfo->wrapperDestroyed(); 232 wrapperTypeInfo->wrapperDestroyed();
233 } 233 }
234 234
235 } // namespace blink 235 } // namespace blink
236 236
237 #endif // DOMDataStore_h 237 #endif // DOMDataStore_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698