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

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

Issue 2751263002: [Bindings] Cache handles for dictionary keys on V8PerIsolateData. (Closed)
Patch Set: findOrCreateEternalNameCache 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp » ('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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // Accessor to the cache of cross-origin accessible operation's templates. 145 // Accessor to the cache of cross-origin accessible operation's templates.
146 // Created templates get automatically cached. 146 // Created templates get automatically cached.
147 v8::Local<v8::FunctionTemplate> findOrCreateOperationTemplate( 147 v8::Local<v8::FunctionTemplate> findOrCreateOperationTemplate(
148 const DOMWrapperWorld&, 148 const DOMWrapperWorld&,
149 const void* key, 149 const void* key,
150 v8::FunctionCallback, 150 v8::FunctionCallback,
151 v8::Local<v8::Value> data, 151 v8::Local<v8::Value> data,
152 v8::Local<v8::Signature>, 152 v8::Local<v8::Signature>,
153 int length); 153 int length);
154 154
155 // Obtains a pointer to an array of names, given a lookup key. If it does not
156 // yet exist, it is created from the given array of strings. Once created,
157 // these live for as long as the isolate, so this is appropriate only for a
158 // compile-time list of related names, such as IDL dictionary keys.
159 const v8::Eternal<v8::Name>* findOrCreateEternalNameCache(
160 const void* lookupKey,
161 const char* const names[],
162 size_t count);
163
155 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>); 164 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>);
156 v8::Local<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, 165 v8::Local<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*,
157 v8::Local<v8::Value>); 166 v8::Local<v8::Value>);
158 167
159 v8::Local<v8::Context> ensureScriptRegexpContext(); 168 v8::Local<v8::Context> ensureScriptRegexpContext();
160 void clearScriptRegexpContext(); 169 void clearScriptRegexpContext();
161 170
162 // EndOfScopeTasks are run when control is returning 171 // EndOfScopeTasks are run when control is returning
163 // to C++ from script, after executing a script task (e.g. callback, 172 // to C++ from script, after executing a script task (e.g. callback,
164 // event) or microtasks (e.g. promise). This is explicitly needed for 173 // event) or microtasks (e.g. promise). This is explicitly needed for
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 240
232 // m_interfaceTemplateMapFor{,Non}MainWorld holds function templates for 241 // m_interfaceTemplateMapFor{,Non}MainWorld holds function templates for
233 // the inerface objects. 242 // the inerface objects.
234 V8FunctionTemplateMap m_interfaceTemplateMapForMainWorld; 243 V8FunctionTemplateMap m_interfaceTemplateMapForMainWorld;
235 V8FunctionTemplateMap m_interfaceTemplateMapForNonMainWorld; 244 V8FunctionTemplateMap m_interfaceTemplateMapForNonMainWorld;
236 // m_operationTemplateMapFor{,Non}MainWorld holds function templates for 245 // m_operationTemplateMapFor{,Non}MainWorld holds function templates for
237 // the cross-origin accessible DOM operations. 246 // the cross-origin accessible DOM operations.
238 V8FunctionTemplateMap m_operationTemplateMapForMainWorld; 247 V8FunctionTemplateMap m_operationTemplateMapForMainWorld;
239 V8FunctionTemplateMap m_operationTemplateMapForNonMainWorld; 248 V8FunctionTemplateMap m_operationTemplateMapForNonMainWorld;
240 249
250 // Contains lists of eternal names, such as dictionary keys.
251 HashMap<const void*, Vector<v8::Eternal<v8::Name>>> m_eternalNameCache;
252
241 std::unique_ptr<StringCache> m_stringCache; 253 std::unique_ptr<StringCache> m_stringCache;
242 std::unique_ptr<V8HiddenValue> m_hiddenValue; 254 std::unique_ptr<V8HiddenValue> m_hiddenValue;
243 std::unique_ptr<V8PrivateProperty> m_privateProperty; 255 std::unique_ptr<V8PrivateProperty> m_privateProperty;
244 ScopedPersistent<v8::Value> m_liveRoot; 256 ScopedPersistent<v8::Value> m_liveRoot;
245 RefPtr<ScriptState> m_scriptRegexpScriptState; 257 RefPtr<ScriptState> m_scriptRegexpScriptState;
246 258
247 bool m_constructorMode; 259 bool m_constructorMode;
248 friend class ConstructorMode; 260 friend class ConstructorMode;
249 261
250 bool m_useCounterDisabled; 262 bool m_useCounterDisabled;
251 friend class UseCounterDisabledScope; 263 friend class UseCounterDisabledScope;
252 264
253 bool m_isHandlingRecursionLevelError; 265 bool m_isHandlingRecursionLevelError;
254 bool m_isReportingException; 266 bool m_isReportingException;
255 267
256 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks; 268 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks;
257 std::unique_ptr<Data> m_threadDebugger; 269 std::unique_ptr<Data> m_threadDebugger;
258 270
259 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables; 271 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables;
260 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor; 272 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor;
261 }; 273 };
262 274
263 } // namespace blink 275 } // namespace blink
264 276
265 #endif // V8PerIsolateData_h 277 #endif // V8PerIsolateData_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698