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

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

Issue 2726593002: Use mayNotBeMainThread() for wrapper optimization (Closed)
Patch Set: Use V8TestingScope 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 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 7c325641b4c02c0ff799256eed33f4f86406063d..3ce0cdabbc5d2aaf2d20f66d338e2997e0c474c9 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -191,15 +191,7 @@ inline void v8SetReturnValue(const CallbackInfo& callbackInfo,
template <typename CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, Node* impl) {
- if (UNLIKELY(!impl)) {
- v8SetReturnValueNull(callbackInfo);
- return;
- }
- if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl))
- return;
- v8::Local<v8::Object> wrapper = ScriptWrappable::fromNode(impl)->wrap(
- callbackInfo.GetIsolate(), callbackInfo.Holder());
- v8SetReturnValue(callbackInfo, wrapper);
+ v8SetReturnValue(callbackInfo, ScriptWrappable::fromNode(impl));
}
// Special versions for DOMWindow and EventTarget
@@ -306,16 +298,8 @@ template <typename CallbackInfo>
inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo,
Node* impl,
const ScriptWrappable* wrappable) {
- if (UNLIKELY(!impl)) {
- v8SetReturnValueNull(callbackInfo);
- return;
- }
- if (DOMDataStore::setReturnValueFast(callbackInfo.GetReturnValue(), impl,
- callbackInfo.Holder(), wrappable))
- return;
- v8::Local<v8::Object> wrapper = ScriptWrappable::fromNode(impl)->wrap(
- callbackInfo.GetIsolate(), callbackInfo.Holder());
- v8SetReturnValue(callbackInfo, wrapper);
+ v8SetReturnValueFast(callbackInfo, ScriptWrappable::fromNode(impl),
+ wrappable);
}
// Special versions for DOMWindow and EventTarget
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ToV8.h ('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