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

Unified Diff: Source/bindings/v8/V8Callback.h

Issue 85263006: Make IDL Callbacks non-refcounted by default (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Refinements Created 7 years, 1 month 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/V8Callback.h
diff --git a/Source/bindings/v8/V8Callback.h b/Source/bindings/v8/V8Callback.h
index c514f67943128cc48c4cf91b1cb742865a0b0b0c..18c90e046814471322b89eb16e020d80b48d5016 100644
--- a/Source/bindings/v8/V8Callback.h
+++ b/Source/bindings/v8/V8Callback.h
@@ -52,20 +52,20 @@ typedef unsigned CallbackAllowedValueFlags;
// 'FunctionOnly' is assumed for the created callback.
template <typename V8CallbackType>
-PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, v8::Isolate* isolate, CallbackAllowedValueFlags acceptedValues = 0)
+PassOwnPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, v8::Isolate* isolate, CallbackAllowedValueFlags acceptedValues = 0)
{
succeeded = true;
if (value->IsUndefined() && (acceptedValues & CallbackAllowUndefined))
- return 0;
+ return nullptr;
haraken 2013/11/27 00:37:11 Nit: Do we prefer nullptr to 0 for an OwnPtr? (I'm
adamk 2013/11/27 00:45:21 Only nullptr will work, in fact! OwnPtr's can't be
if (value->IsNull() && (acceptedValues & CallbackAllowNull))
- return 0;
+ return nullptr;
if (!value->IsFunction()) {
succeeded = false;
setDOMException(TypeMismatchError, isolate);
- return 0;
+ return nullptr;
}
return V8CallbackType::create(value, getExecutionContext());

Powered by Google App Engine
This is Rietveld 408576698