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

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: const Created 3 years, 9 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 the set of well-known dictionary keys identified by
156 // the lookup key, or creates it from an array of static strings.
157 // TODO(jbroman): v8::Eternal::Get should be const.
158 const v8::Eternal<v8::Name>* findOrCreateKeys(const void* lookupKey,
159 const char* const keys[],
160 size_t keyCount);
161
155 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>); 162 bool hasInstance(const WrapperTypeInfo* untrusted, v8::Local<v8::Value>);
156 v8::Local<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*, 163 v8::Local<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*,
157 v8::Local<v8::Value>); 164 v8::Local<v8::Value>);
158 165
159 v8::Local<v8::Context> ensureScriptRegexpContext(); 166 v8::Local<v8::Context> ensureScriptRegexpContext();
160 void clearScriptRegexpContext(); 167 void clearScriptRegexpContext();
161 168
162 // EndOfScopeTasks are run when control is returning 169 // EndOfScopeTasks are run when control is returning
163 // to C++ from script, after executing a script task (e.g. callback, 170 // to C++ from script, after executing a script task (e.g. callback,
164 // event) or microtasks (e.g. promise). This is explicitly needed for 171 // event) or microtasks (e.g. promise). This is explicitly needed for
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 238
232 // m_interfaceTemplateMapFor{,Non}MainWorld holds function templates for 239 // m_interfaceTemplateMapFor{,Non}MainWorld holds function templates for
233 // the inerface objects. 240 // the inerface objects.
234 V8FunctionTemplateMap m_interfaceTemplateMapForMainWorld; 241 V8FunctionTemplateMap m_interfaceTemplateMapForMainWorld;
235 V8FunctionTemplateMap m_interfaceTemplateMapForNonMainWorld; 242 V8FunctionTemplateMap m_interfaceTemplateMapForNonMainWorld;
236 // m_operationTemplateMapFor{,Non}MainWorld holds function templates for 243 // m_operationTemplateMapFor{,Non}MainWorld holds function templates for
237 // the cross-origin accessible DOM operations. 244 // the cross-origin accessible DOM operations.
238 V8FunctionTemplateMap m_operationTemplateMapForMainWorld; 245 V8FunctionTemplateMap m_operationTemplateMapForMainWorld;
239 V8FunctionTemplateMap m_operationTemplateMapForNonMainWorld; 246 V8FunctionTemplateMap m_operationTemplateMapForNonMainWorld;
240 247
248 // Contains direct pointers to well-known dictionary keys.
249 HashMap<const void*, Vector<v8::Eternal<v8::Name>>> m_keyMap;
250
241 std::unique_ptr<StringCache> m_stringCache; 251 std::unique_ptr<StringCache> m_stringCache;
242 std::unique_ptr<V8HiddenValue> m_hiddenValue; 252 std::unique_ptr<V8HiddenValue> m_hiddenValue;
243 std::unique_ptr<V8PrivateProperty> m_privateProperty; 253 std::unique_ptr<V8PrivateProperty> m_privateProperty;
244 ScopedPersistent<v8::Value> m_liveRoot; 254 ScopedPersistent<v8::Value> m_liveRoot;
245 RefPtr<ScriptState> m_scriptRegexpScriptState; 255 RefPtr<ScriptState> m_scriptRegexpScriptState;
246 256
247 bool m_constructorMode; 257 bool m_constructorMode;
248 friend class ConstructorMode; 258 friend class ConstructorMode;
249 259
250 bool m_useCounterDisabled; 260 bool m_useCounterDisabled;
251 friend class UseCounterDisabledScope; 261 friend class UseCounterDisabledScope;
252 262
253 bool m_isHandlingRecursionLevelError; 263 bool m_isHandlingRecursionLevelError;
254 bool m_isReportingException; 264 bool m_isReportingException;
255 265
256 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks; 266 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks;
257 std::unique_ptr<Data> m_threadDebugger; 267 std::unique_ptr<Data> m_threadDebugger;
258 268
259 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables; 269 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables;
260 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor; 270 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor;
261 }; 271 };
262 272
263 } // namespace blink 273 } // namespace blink
264 274
265 #endif // V8PerIsolateData_h 275 #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