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

Unified Diff: Source/bindings/v8/custom/V8MutationObserverCustom.cpp

Issue 15877002: move constructors to new style callbacks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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: Source/bindings/v8/custom/V8MutationObserverCustom.cpp
diff --git a/Source/bindings/v8/custom/V8MutationObserverCustom.cpp b/Source/bindings/v8/custom/V8MutationObserverCustom.cpp
index be56c23059735878fa5342ba3107f9324f7fd2ca..24cc5a208da4e93c7b93b474fca6b61ab5c91689 100644
--- a/Source/bindings/v8/custom/V8MutationObserverCustom.cpp
+++ b/Source/bindings/v8/custom/V8MutationObserverCustom.cpp
@@ -41,14 +41,18 @@
namespace WebCore {
-v8::Handle<v8::Value> V8MutationObserver::constructorCustom(const v8::Arguments& args)
+void V8MutationObserver::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
- if (args.Length() < 1)
- return throwNotEnoughArgumentsError(args.GetIsolate());
+ if (args.Length() < 1) {
+ throwNotEnoughArgumentsError(args.GetIsolate());
+ return;
+ }
v8::Local<v8::Value> arg = args[0];
- if (!arg->IsFunction())
- return throwTypeError("Callback argument must be a function", args.GetIsolate());
+ if (!arg->IsFunction()) {
+ throwTypeError("Callback argument must be a function", args.GetIsolate());
+ return;
+ }
ScriptExecutionContext* context = getScriptExecutionContext();
v8::Handle<v8::Object> wrapper = args.Holder();
@@ -57,7 +61,7 @@ v8::Handle<v8::Value> V8MutationObserver::constructorCustom(const v8::Arguments&
RefPtr<MutationObserver> observer = MutationObserver::create(callback.release());
V8DOMWrapper::associateObjectWithWrapper(observer.release(), &info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
- return wrapper;
+ args.GetReturnValue().Set(wrapper);
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698