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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h

Issue 2003593003: Make CustomElementsRegistry lazily initialize script state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Does not use a separate representation of initialized state. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
index de7d2aaa98ccb722181a7683df4dfefd92421b95..c55a0453b495acff8cae4dc916f61873521b1708 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
@@ -29,9 +29,8 @@ class CORE_EXPORT CustomElementsRegistry final
DEFINE_WRAPPERTYPEINFO();
public:
using Id = uint32_t;
- static CustomElementsRegistry* create(
- ScriptState*,
- V0CustomElementRegistrationContext*);
+
+ static CustomElementsRegistry* create(V0CustomElementRegistrationContext*);
void define(
ScriptState*,
@@ -55,10 +54,13 @@ public:
private:
CustomElementsRegistry(const V0CustomElementRegistrationContext*);
+ // Initializes the state which is kept in the V8 heap. Initializes
+ // the map handle to the constructor->id, id->prototype map; see
+ // idMap.
+ void initializeScript(ScriptState*, v8::Local<v8::Map>&);
esprehn 2016/05/23 21:45:17 add variable name for the map, only leave off the
+
// Retrieves the Map which, given a constructor, contains the id
// of the definition; or given an id, contains the prototype.
- // Returns true if the map was retrieved; false if the map was
- // not initialized yet.
v8::Local<v8::Map> idMap(ScriptState*);
bool idForConstructor(

Powered by Google App Engine
This is Rietveld 408576698