Changeset 83115 in webkit
- Timestamp:
- Apr 6, 2011 4:01:30 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83113 r83115 1 2011-04-06 Leandro Gracia Gil <leandrogracia@chromium.org> 2 3 Reviewed by Steve Block. 4 5 Make the style of createFunctionOnlyCallback in V8 consistent with the JavaScriptCore version. 6 https://bugs.webkit.org/show_bug.cgi?id=57963 7 8 No new tests. LayoutTests/fast/dom/Geolocation/argument-types.html 9 10 * bindings/v8/V8Utilities.h: 11 (WebCore::createFunctionOnlyCallback): 12 * bindings/v8/custom/V8GeolocationCustom.cpp: 13 (WebCore::V8Geolocation::getCurrentPositionCallback): 14 (WebCore::V8Geolocation::watchPositionCallback): 15 1 16 2011-04-06 Brian Weinstein <bweinstein@apple.com> 2 17 -
trunk/Source/WebCore/bindings/v8/V8Utilities.h
r82940 r83115 59 59 60 60 enum CallbackAllowedValueFlag { 61 CallbackAllowFunction = 0,62 61 CallbackAllowUndefined = 1, 63 62 CallbackAllowNull = 1 << 1 … … 68 67 // 'FunctionOnly' is assumed for the created callback. 69 68 template <typename V8CallbackType> 70 PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, CallbackAllowedValueFlags acceptedValues, bool& succeeded)69 PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, CallbackAllowedValueFlags acceptedValues = 0) 71 70 { 72 71 succeeded = true; 73 72 74 if ((value->IsUndefined() && (acceptedValues & CallbackAllowUndefined)) 75 || (value->IsNull() && (acceptedValues & CallbackAllowNull))) 73 if (value->IsUndefined() && (acceptedValues & CallbackAllowUndefined)) 74 return 0; 75 76 if (value->IsNull() && (acceptedValues & CallbackAllowNull)) 76 77 return 0; 77 78 -
trunk/Source/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp
r82940 r83115 134 134 bool succeeded = false; 135 135 136 RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8CustomPositionCallback>(args[0], CallbackAllowFunction,succeeded);136 RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8CustomPositionCallback>(args[0], succeeded); 137 137 if (!succeeded) 138 138 return v8::Undefined(); … … 140 140 141 141 // Argument is optional (hence undefined is allowed), and null is allowed. 142 RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8CustomPositionErrorCallback>(args[1], CallbackAllowUndefined | CallbackAllowNull, succeeded);142 RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8CustomPositionErrorCallback>(args[1], succeeded, CallbackAllowUndefined | CallbackAllowNull); 143 143 if (!succeeded) 144 144 return v8::Undefined(); … … 160 160 bool succeeded = false; 161 161 162 RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8CustomPositionCallback>(args[0], CallbackAllowFunction,succeeded);162 RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8CustomPositionCallback>(args[0], succeeded); 163 163 if (!succeeded) 164 164 return v8::Undefined(); … … 166 166 167 167 // Argument is optional (hence undefined is allowed), and null is allowed. 168 RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8CustomPositionErrorCallback>(args[1], CallbackAllowUndefined | CallbackAllowNull, succeeded);168 RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8CustomPositionErrorCallback>(args[1], succeeded, CallbackAllowUndefined | CallbackAllowNull); 169 169 if (!succeeded) 170 170 return v8::Undefined();
Note: See TracChangeset
for help on using the changeset viewer.