Changeset 118133 in webkit
- Timestamp:
- May 23, 2012 12:06:11 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r118131 r118133 1 2012-05-23 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Pass Isolate to v8::Null() in custom bindings (Part 1) 4 https://bugs.webkit.org/show_bug.cgi?id=87207 5 6 Reviewed by Adam Barth. 7 8 The objective is to pass Isolate around in V8 bindings. 9 This patch passes Isolate to v8::Null() in custom bindings. 10 11 Also this patch makes V8DeviceMotionEventCustom::createAccelerationObject() 12 and V8DeviceMotionEventCustom::createRotationRateObject() static. 13 14 No tests. No change in behavior. 15 16 * bindings/v8/custom/V8BlobCustom.cpp: 17 (WebCore::toV8): 18 * bindings/v8/custom/V8CSSRuleCustom.cpp: 19 (WebCore::toV8): 20 * bindings/v8/custom/V8CSSStyleSheetCustom.cpp: 21 (WebCore::toV8): 22 * bindings/v8/custom/V8CSSValueCustom.cpp: 23 (WebCore::toV8): 24 * bindings/v8/custom/V8ClipboardCustom.cpp: 25 (WebCore::V8Clipboard::typesAccessorGetter): 26 * bindings/v8/custom/V8CoordinatesCustom.cpp: 27 (WebCore::V8Coordinates::altitudeAccessorGetter): 28 (WebCore::V8Coordinates::altitudeAccuracyAccessorGetter): 29 (WebCore::V8Coordinates::headingAccessorGetter): 30 (WebCore::V8Coordinates::speedAccessorGetter): 31 * bindings/v8/custom/V8DOMStringMapCustom.cpp: 32 (WebCore::toV8): 33 * bindings/v8/custom/V8DOMTokenListCustom.cpp: 34 (WebCore::toV8): 35 * bindings/v8/custom/V8DOMWindowCustom.cpp: 36 (WebCore::toV8): 37 * bindings/v8/custom/V8DataViewCustom.cpp: 38 (WebCore::toV8): 39 * bindings/v8/custom/V8DeviceMotionEventCustom.cpp: 40 (WebCore::V8DeviceMotionEvent::accelerationAccessorGetter): 41 (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAccessorGetter): 42 (WebCore::V8DeviceMotionEvent::rotationRateAccessorGetter): 43 (WebCore::V8DeviceMotionEvent::intervalAccessorGetter): 44 * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp: 45 (WebCore::V8DeviceOrientationEvent::alphaAccessorGetter): 46 (WebCore::V8DeviceOrientationEvent::betaAccessorGetter): 47 (WebCore::V8DeviceOrientationEvent::gammaAccessorGetter): 48 (WebCore::V8DeviceOrientationEvent::absoluteAccessorGetter): 49 * bindings/v8/custom/V8DocumentCustom.cpp: 50 (WebCore::toV8): 51 * bindings/v8/custom/V8DocumentLocationCustom.cpp: 52 (WebCore::V8Document::locationAccessorGetter): 53 * bindings/v8/custom/V8EntryCustom.cpp: 54 (WebCore::toV8): 55 * bindings/v8/custom/V8EntrySyncCustom.cpp: 56 (WebCore::toV8): 57 * bindings/v8/custom/V8EventCustom.cpp: 58 (WebCore::toV8): 59 * bindings/v8/custom/V8Float32ArrayCustom.cpp: 60 (WebCore::toV8): 61 * bindings/v8/custom/V8Float64ArrayCustom.cpp: 62 (WebCore::toV8): 63 * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp: 64 (WebCore::V8HTMLCanvasElement::getContextCallback): 65 * bindings/v8/custom/V8HTMLDocumentCustom.cpp: 66 (WebCore::toV8): 67 1 68 2012-05-22 MORITA Hajime <morrita@google.com> 2 69 -
trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp
r118071 r118133 48 48 { 49 49 if (!impl) 50 return v8::Null( );50 return v8::Null(isolate); 51 51 52 52 if (impl->isFile()) -
trunk/Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp
r115366 r118133 47 47 { 48 48 if (!impl) 49 return v8::Null( );49 return v8::Null(isolate); 50 50 switch (impl->type()) { 51 51 case CSSRule::UNKNOWN_RULE: -
trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleSheetCustom.cpp
r115366 r118133 40 40 { 41 41 if (!impl) 42 return v8::Null( );42 return v8::Null(isolate); 43 43 v8::Handle<v8::Object> wrapper = V8CSSStyleSheet::wrap(impl, isolate); 44 44 // Add a hidden reference from stylesheet object to its owner node. -
trunk/Source/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp
r115366 r118133 46 46 { 47 47 if (!impl) 48 return v8::Null( );48 return v8::Null(isolate); 49 49 if (impl->isWebKitCSSTransformValue()) 50 50 return toV8(static_cast<WebKitCSSTransformValue*>(impl), isolate); -
trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
r118071 r118133 52 52 HashSet<String> types = clipboard->types(); 53 53 if (types.isEmpty()) 54 return v8::Null( );54 return v8::Null(info.GetIsolate()); 55 55 56 56 v8::Local<v8::Array> result = v8::Array::New(types.size()); -
trunk/Source/WebCore/bindings/v8/custom/V8CoordinatesCustom.cpp
r95901 r118133 39 39 Coordinates* imp = V8Coordinates::toNative(holder); 40 40 if (!imp->canProvideAltitude()) 41 return v8::Null( );41 return v8::Null(info.GetIsolate()); 42 42 return v8::Number::New(imp->altitude()); 43 43 } … … 49 49 Coordinates* imp = V8Coordinates::toNative(holder); 50 50 if (!imp->canProvideAltitudeAccuracy()) 51 return v8::Null( );51 return v8::Null(info.GetIsolate()); 52 52 return v8::Number::New(imp->altitudeAccuracy()); 53 53 } … … 59 59 Coordinates* imp = V8Coordinates::toNative(holder); 60 60 if (!imp->canProvideHeading()) 61 return v8::Null( );61 return v8::Null(info.GetIsolate()); 62 62 return v8::Number::New(imp->heading()); 63 63 } … … 69 69 Coordinates* imp = V8Coordinates::toNative(holder); 70 70 if (!imp->canProvideSpeed()) 71 return v8::Null( );71 return v8::Null(info.GetIsolate()); 72 72 return v8::Number::New(imp->speed()); 73 73 } -
trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
r117873 r118133 88 88 { 89 89 if (!impl) 90 return v8::Null( );90 return v8::Null(isolate); 91 91 v8::Handle<v8::Object> wrapper = V8DOMStringMap::wrap(impl, isolate); 92 92 // Add a hidden reference from the element to the DOMStringMap. -
trunk/Source/WebCore/bindings/v8/custom/V8DOMTokenListCustom.cpp
r115366 r118133 42 42 { 43 43 if (!impl) 44 return v8::Null( );44 return v8::Null(isolate); 45 45 v8::Handle<v8::Object> wrapper = V8DOMTokenList::wrap(impl, isolate); 46 46 // Add a hidden reference from the element to the DOMTokenList. -
trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
r118063 r118133 604 604 { 605 605 if (!window) 606 return v8::Null( );606 return v8::Null(isolate); 607 607 // Initializes environment of a frame, and return the global object 608 608 // of the frame. -
trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp
r118071 r118133 61 61 { 62 62 if (!impl) 63 return v8::Null( );63 return v8::Null(isolate); 64 64 return V8DataView::wrap(impl, isolate); 65 65 } -
trunk/Source/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
r68257 r118133 40 40 namespace { 41 41 42 v8::Handle<v8::Value> createAccelerationObject(const DeviceMotionData::Acceleration* acceleration)42 static v8::Handle<v8::Value> createAccelerationObject(const DeviceMotionData::Acceleration* acceleration, v8::Isolate* isolate) 43 43 { 44 44 v8::Local<v8::Object> object = v8::Object::New(); 45 object->Set(v8::String::New("x"), acceleration->canProvideX() ? v8::Number::New(acceleration->x()) : v8::Null( ));46 object->Set(v8::String::New("y"), acceleration->canProvideY() ? v8::Number::New(acceleration->y()) : v8::Null( ));47 object->Set(v8::String::New("z"), acceleration->canProvideZ() ? v8::Number::New(acceleration->z()) : v8::Null( ));45 object->Set(v8::String::New("x"), acceleration->canProvideX() ? v8::Number::New(acceleration->x()) : v8::Null(isolate)); 46 object->Set(v8::String::New("y"), acceleration->canProvideY() ? v8::Number::New(acceleration->y()) : v8::Null(isolate)); 47 object->Set(v8::String::New("z"), acceleration->canProvideZ() ? v8::Number::New(acceleration->z()) : v8::Null(isolate)); 48 48 return object; 49 49 } 50 50 51 v8::Handle<v8::Value> createRotationRateObject(const DeviceMotionData::RotationRate* rotationRate)51 static v8::Handle<v8::Value> createRotationRateObject(const DeviceMotionData::RotationRate* rotationRate, v8::Isolate* isolate) 52 52 { 53 53 v8::Local<v8::Object> object = v8::Object::New(); 54 object->Set(v8::String::New("alpha"), rotationRate->canProvideAlpha() ? v8::Number::New(rotationRate->alpha()) : v8::Null( ));55 object->Set(v8::String::New("beta"), rotationRate->canProvideBeta() ? v8::Number::New(rotationRate->beta()) : v8::Null( ));56 object->Set(v8::String::New("gamma"), rotationRate->canProvideGamma() ? v8::Number::New(rotationRate->gamma()) : v8::Null( ));54 object->Set(v8::String::New("alpha"), rotationRate->canProvideAlpha() ? v8::Number::New(rotationRate->alpha()) : v8::Null(isolate)); 55 object->Set(v8::String::New("beta"), rotationRate->canProvideBeta() ? v8::Number::New(rotationRate->beta()) : v8::Null(isolate)); 56 object->Set(v8::String::New("gamma"), rotationRate->canProvideGamma() ? v8::Number::New(rotationRate->gamma()) : v8::Null(isolate)); 57 57 return object; 58 58 } … … 130 130 DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder); 131 131 if (!imp->deviceMotionData()->acceleration()) 132 return v8::Null( );133 return createAccelerationObject(imp->deviceMotionData()->acceleration() );132 return v8::Null(info.GetIsolate()); 133 return createAccelerationObject(imp->deviceMotionData()->acceleration(), info.GetIsolate()); 134 134 } 135 135 … … 140 140 DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder); 141 141 if (!imp->deviceMotionData()->accelerationIncludingGravity()) 142 return v8::Null( );143 return createAccelerationObject(imp->deviceMotionData()->accelerationIncludingGravity() );142 return v8::Null(info.GetIsolate()); 143 return createAccelerationObject(imp->deviceMotionData()->accelerationIncludingGravity(), info.GetIsolate()); 144 144 } 145 145 … … 150 150 DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder); 151 151 if (!imp->deviceMotionData()->rotationRate()) 152 return v8::Null( );153 return createRotationRateObject(imp->deviceMotionData()->rotationRate() );152 return v8::Null(info.GetIsolate()); 153 return createRotationRateObject(imp->deviceMotionData()->rotationRate(), info.GetIsolate()); 154 154 } 155 155 … … 160 160 DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder); 161 161 if (!imp->deviceMotionData()->canProvideInterval()) 162 return v8::Null( );162 return v8::Null(info.GetIsolate()); 163 163 return v8::Number::New(imp->deviceMotionData()->interval()); 164 164 } -
trunk/Source/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp
r105036 r118133 44 44 DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder); 45 45 if (!imp->orientation()->canProvideAlpha()) 46 return v8::Null( );46 return v8::Null(info.GetIsolate()); 47 47 return v8::Number::New(imp->orientation()->alpha()); 48 48 } … … 54 54 DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder); 55 55 if (!imp->orientation()->canProvideBeta()) 56 return v8::Null( );56 return v8::Null(info.GetIsolate()); 57 57 return v8::Number::New(imp->orientation()->beta()); 58 58 } … … 64 64 DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder); 65 65 if (!imp->orientation()->canProvideGamma()) 66 return v8::Null( );66 return v8::Null(info.GetIsolate()); 67 67 return v8::Number::New(imp->orientation()->gamma()); 68 68 } … … 74 74 DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder); 75 75 if (!imp->orientation()->canProvideAbsolute()) 76 return v8::Null( );76 return v8::Null(info.GetIsolate()); 77 77 return v8::Boolean::New(imp->orientation()->absolute()); 78 78 } -
trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
r117733 r118133 120 120 { 121 121 if (!impl) 122 return v8::Null( );122 return v8::Null(isolate); 123 123 if (impl->isHTMLDocument()) 124 124 return toV8(static_cast<HTMLDocument*>(impl), isolate, forceNewObject); -
trunk/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp
r114925 r118133 39 39 Document* document = V8Document::toNative(info.Holder()); 40 40 if (!document->frame()) 41 return v8::Null( );41 return v8::Null(info.GetIsolate()); 42 42 43 43 DOMWindow* window = document->frame()->domWindow(); -
trunk/Source/WebCore/bindings/v8/custom/V8EntryCustom.cpp
r114925 r118133 48 48 { 49 49 if (!impl) 50 return v8::Null( );50 return v8::Null(isolate); 51 51 52 52 if (impl->isFile()) -
trunk/Source/WebCore/bindings/v8/custom/V8EntrySyncCustom.cpp
r114925 r118133 48 48 { 49 49 if (!impl) 50 return v8::Null( );50 return v8::Null(isolate); 51 51 52 52 if (impl->isFile()) -
trunk/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp
r115366 r118133 77 77 { 78 78 if (!event) 79 return v8::Null( );79 return v8::Null(isolate); 80 80 81 81 String desiredInterface = event->interfaceName(); -
trunk/Source/WebCore/bindings/v8/custom/V8Float32ArrayCustom.cpp
r115366 r118133 58 58 { 59 59 if (!impl) 60 return v8::Null( );60 return v8::Null(isolate); 61 61 v8::Handle<v8::Object> wrapper = V8Float32Array::wrap(impl, isolate); 62 62 if (!wrapper.IsEmpty()) -
trunk/Source/WebCore/bindings/v8/custom/V8Float64ArrayCustom.cpp
r115366 r118133 53 53 { 54 54 if (!impl) 55 return v8::Null( );55 return v8::Null(isolate); 56 56 v8::Handle<v8::Object> wrapper = V8Float64Array::wrap(impl, isolate); 57 57 if (!wrapper.IsEmpty()) -
trunk/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
r115068 r118133 85 85 CanvasRenderingContext* result = imp->getContext(contextId, attrs.get()); 86 86 if (!result) 87 return v8::Null( );87 return v8::Null(args.GetIsolate()); 88 88 if (result->is2d()) 89 89 return toV8(static_cast<CanvasRenderingContext2D*>(result), args.GetIsolate()); … … 93 93 #endif 94 94 ASSERT_NOT_REACHED(); 95 return v8::Null( );95 return v8::Null(args.GetIsolate()); 96 96 } 97 97 -
trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
r118071 r118133 188 188 { 189 189 if (!impl) 190 return v8::Null( );190 return v8::Null(isolate); 191 191 v8::Handle<v8::Object> wrapper = V8HTMLDocument::wrap(impl, isolate, forceNewObject); 192 192 if (wrapper.IsEmpty())
Note: See TracChangeset
for help on using the changeset viewer.