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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h

Issue 2335203006: Add [CachedAccessor] attribute to cache (almost) constant accessors (window.document). (Closed)
Patch Set: Polishing + naming revisited Created 4 years, 3 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/bindings/core/v8/V8PrivateProperty.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h b/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h
index 486aa74b6e3dea76e66c0fd37bc3079f99764034..e1b527620939bd32892df79ddeb45f47b549253b 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h
@@ -21,20 +21,21 @@ class ScriptState;
class ScriptWrappable;
// Apply |X| for each pair of (InterfaceName, PrivateKeyName).
-#define V8_PRIVATE_PROPERTY_FOR_EACH(X) \
- X(CustomEvent, Detail) \
- X(DOMException, Error) \
- X(ErrorEvent, Error) \
- X(IDBObserver, Callback) \
- X(IntersectionObserver, Callback) \
- X(MessageEvent, CachedData) \
- X(MutationObserver, Callback) \
- X(PerformanceObserver, Callback) \
+#define V8_PRIVATE_PROPERTY_FOR_EACH(X) \
+ X(CustomEvent, Detail) \
+ X(DOMException, Error) \
+ X(ErrorEvent, Error) \
+ X(IDBObserver, Callback) \
+ X(IntersectionObserver, Callback) \
+ X(MessageEvent, CachedData) \
+ X(MutationObserver, Callback) \
+ X(PerformanceObserver, Callback) \
X(PrivateScriptRunner, IsInitialized) \
- X(SameObject, NotificationActions) \
- X(SameObject, NotificationData) \
- X(SameObject, NotificationVibrate) \
- X(V8NodeFilterCondition, Filter)
+ X(SameObject, NotificationActions) \
+ X(SameObject, NotificationData) \
+ X(SameObject, NotificationVibrate) \
+ X(V8NodeFilterCondition, Filter) \
+ X(Window, Document)
haraken 2016/09/20 14:15:03 I'd prefer X(Window, DocumentCachedAccessor) to av
// The getter's name for a private property.
#define V8_PRIVATE_PROPERTY_GETTER_NAME(InterfaceName, PrivateKeyName) \
@@ -101,6 +102,11 @@ public:
return v8CallBoolean(object->SetPrivate(context, m_privateSymbol, value));
}
+ v8::Local<v8::Private> getPrivate()
+ {
+ return m_privateSymbol;
+ }
+
private:
friend class V8PrivateProperty;
// The following classes are exceptionally allowed to call to

Powered by Google App Engine
This is Rietveld 408576698