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

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

Issue 2617733004: binding: Changes the association among global-proxy/global/window-instance. (Closed)
Patch Set: Addressed review comments. Created 3 years, 10 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/V8Binding.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
index 2a529350f0df9b34134f212ab90e5773cc727f21..8df4565ec2c0e61384ba263ed524172a55e7dba3 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -202,22 +202,6 @@ inline void v8SetReturnValue(const CallbackInfo& callbackInfo, Node* impl) {
v8SetReturnValue(callbackInfo, wrapper);
}
-// Special versions for DOMWindow and EventTarget
-
-template <typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo,
- DOMWindow* impl) {
- v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(),
- callbackInfo.GetIsolate()));
-}
-
-template <typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo,
- EventTarget* impl) {
- v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(),
- callbackInfo.GetIsolate()));
-}
-
template <typename CallbackInfo, typename T>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo,
PassRefPtr<T> impl) {
@@ -240,46 +224,6 @@ inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo,
v8SetReturnValue(callbackInfo, wrapper);
}
-template <typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo,
- Node* impl) {
- // Since EventTarget has a special version of ToV8 and V8EventTarget.h
- // defines its own v8SetReturnValue family, which are slow, we need to
- // override them with optimized versions for Node and its subclasses.
- // Without this overload, v8SetReturnValueForMainWorld for Node would be
- // very slow.
- //
- // class hierarchy:
- // ScriptWrappable <-- EventTarget <--+-- Node <-- ...
- // +-- Window
- // overloads:
- // v8SetReturnValueForMainWorld(ScriptWrappable*)
- // Optimized and very fast.
- // v8SetReturnValueForMainWorld(EventTarget*)
- // Uses custom toV8 function and slow.
- // v8SetReturnValueForMainWorld(Node*)
- // Optimized and very fast.
- // v8SetReturnValueForMainWorld(Window*)
- // Uses custom toV8 function and slow.
- v8SetReturnValueForMainWorld(callbackInfo, ScriptWrappable::fromNode(impl));
-}
-
-// Special versions for DOMWindow and EventTarget
-
-template <typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo,
- DOMWindow* impl) {
- v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(),
- callbackInfo.GetIsolate()));
-}
-
-template <typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo,
- EventTarget* impl) {
- v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(),
- callbackInfo.GetIsolate()));
-}
-
template <typename CallbackInfo, typename T>
inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo,
PassRefPtr<T> impl) {
@@ -318,24 +262,6 @@ inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo,
v8SetReturnValue(callbackInfo, wrapper);
}
-// Special versions for DOMWindow and EventTarget
-
-template <typename CallbackInfo>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo,
- DOMWindow* impl,
- const ScriptWrappable*) {
- v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(),
- callbackInfo.GetIsolate()));
-}
-
-template <typename CallbackInfo>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo,
- EventTarget* impl,
- const ScriptWrappable*) {
- v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(),
- callbackInfo.GetIsolate()));
-}
-
template <typename CallbackInfo, typename T, typename Wrappable>
inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo,
PassRefPtr<T> impl,
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ToV8.cpp ('k') | third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698