Changeset 141718 in webkit


Ignore:
Timestamp:
Feb 3, 2013 3:26:25 PM (11 years ago)
Author:
haraken@chromium.org
Message:

[V8] Pass an Isolate to HasInstance() (part 2)
https://bugs.webkit.org/show_bug.cgi?id=108620

Reviewed by Adam Barth.

This is one of efforts to pass an Isolate to GetTemplate().

No tests. No change in behavior.

  • bindings/v8/custom/V8ArrayBufferViewCustom.h:

(WebCore::constructWebGLArray):
(WebCore::setWebGLArrayHelper):

  • bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:

(WebCore::V8AudioBufferSourceNode::bufferAccessorSetter):

  • bindings/v8/custom/V8BlobCustom.cpp:

(WebCore::V8Blob::constructorCallbackCustom):

  • bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:

(WebCore::toCanvasStyle):
(WebCore::V8CanvasRenderingContext2D::strokeStyleAccessorSetter):

  • bindings/v8/custom/V8ClipboardCustom.cpp:

(WebCore::V8Clipboard::setDragImageCallback):

  • bindings/v8/custom/V8CryptoCustom.cpp:

(WebCore::V8Crypto::getRandomValuesCallback):

  • bindings/v8/custom/V8DOMFormDataCustom.cpp:

(WebCore::V8DOMFormData::constructorCallbackCustom):
(WebCore::V8DOMFormData::appendCallback):

  • bindings/v8/custom/V8DataViewCustom.cpp:

(WebCore::V8DataView::constructorCallbackCustom):

  • bindings/v8/custom/V8DocumentCustom.cpp:

(WebCore::V8Document::evaluateCallback):

  • bindings/v8/custom/V8HTMLMediaElementCustom.cpp:

(WebCore::V8HTMLMediaElement::controllerAccessorSetter):

  • bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:

(WebCore::V8HTMLOptionsCollection::addCallback):

  • bindings/v8/custom/V8HTMLSelectElementCustom.cpp:

(WebCore::removeElement):

Location:
trunk/Source/WebCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141717 r141718  
     12013-02-03  Kentaro Hara  <haraken@chromium.org>
     2
     3        [V8] Pass an Isolate to HasInstance() (part 2)
     4        https://bugs.webkit.org/show_bug.cgi?id=108620
     5
     6        Reviewed by Adam Barth.
     7
     8        This is one of efforts to pass an Isolate to GetTemplate().
     9
     10        No tests. No change in behavior.
     11
     12        * bindings/v8/custom/V8ArrayBufferViewCustom.h:
     13        (WebCore::constructWebGLArray):
     14        (WebCore::setWebGLArrayHelper):
     15        * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:
     16        (WebCore::V8AudioBufferSourceNode::bufferAccessorSetter):
     17        * bindings/v8/custom/V8BlobCustom.cpp:
     18        (WebCore::V8Blob::constructorCallbackCustom):
     19        * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
     20        (WebCore::toCanvasStyle):
     21        (WebCore::V8CanvasRenderingContext2D::strokeStyleAccessorSetter):
     22        * bindings/v8/custom/V8ClipboardCustom.cpp:
     23        (WebCore::V8Clipboard::setDragImageCallback):
     24        * bindings/v8/custom/V8CryptoCustom.cpp:
     25        (WebCore::V8Crypto::getRandomValuesCallback):
     26        * bindings/v8/custom/V8DOMFormDataCustom.cpp:
     27        (WebCore::V8DOMFormData::constructorCallbackCustom):
     28        (WebCore::V8DOMFormData::appendCallback):
     29        * bindings/v8/custom/V8DataViewCustom.cpp:
     30        (WebCore::V8DataView::constructorCallbackCustom):
     31        * bindings/v8/custom/V8DocumentCustom.cpp:
     32        (WebCore::V8Document::evaluateCallback):
     33        * bindings/v8/custom/V8HTMLMediaElementCustom.cpp:
     34        (WebCore::V8HTMLMediaElement::controllerAccessorSetter):
     35        * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
     36        (WebCore::V8HTMLOptionsCollection::addCallback):
     37        * bindings/v8/custom/V8HTMLSelectElementCustom.cpp:
     38        (WebCore::removeElement):
     39
    1402013-02-03  Mike West  <mkwst@chromium.org>
    241
  • trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h

    r139601 r141718  
    140140
    141141    // See whether the first argument is a ArrayBuffer.
    142     if (V8ArrayBuffer::HasInstance(args[0]))
     142    if (V8ArrayBuffer::HasInstance(args[0], args.GetIsolate()))
    143143      return constructWebGLArrayWithArrayBufferArgument<ArrayClass, ElementType>(args, type, arrayType, true);
    144144
    145145    // See whether the first argument is the same type as impl. In that case,
    146146    // we can simply memcpy data from source to impl.
    147     if (JavaScriptWrapperArrayType::HasInstance(args[0])) {
     147    if (JavaScriptWrapperArrayType::HasInstance(args[0], args.GetIsolate())) {
    148148        ArrayClass* source = JavaScriptWrapperArrayType::toNative(args[0]->ToObject());
    149149        uint32_t length = source->length();
     
    239239    CPlusPlusArrayType* impl = JavaScriptWrapperArrayType::toNative(args.Holder());
    240240
    241     if (JavaScriptWrapperArrayType::HasInstance(args[0])) {
     241    if (JavaScriptWrapperArrayType::HasInstance(args[0], args.GetIsolate())) {
    242242        // void set(in WebGL<T>Array array, [Optional] in unsigned long offset);
    243243        CPlusPlusArrayType* src = JavaScriptWrapperArrayType::toNative(args[0]->ToObject());
  • trunk/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp

    r138665 r141718  
    4343
    4444    AudioBuffer* buffer = 0;
    45     if (V8AudioBuffer::HasInstance(value)) {
     45    if (V8AudioBuffer::HasInstance(value, info.GetIsolate())) {
    4646        buffer = V8AudioBuffer::toNative(value->ToObject());
    4747        if (buffer && !imp->setBuffer(buffer)) {
  • trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp

    r135847 r141718  
    9898        ASSERT(!item.IsEmpty());
    9999#if ENABLE(BLOB)
    100         if (V8ArrayBuffer::HasInstance(item)) {
     100        if (V8ArrayBuffer::HasInstance(item, args.GetIsolate())) {
    101101            ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(item));
    102102            ASSERT(arrayBuffer);
    103103            blobBuilder.append(context, arrayBuffer);
    104         } else if (V8ArrayBufferView::HasInstance(item)) {
     104        } else if (V8ArrayBufferView::HasInstance(item, args.GetIsolate())) {
    105105            ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(item));
    106106            ASSERT(arrayBufferView);
     
    108108        } else
    109109#endif
    110         if (V8Blob::HasInstance(item)) {
     110        if (V8Blob::HasInstance(item, args.GetIsolate())) {
    111111            Blob* blob = V8Blob::toNative(v8::Handle<v8::Object>::Cast(item));
    112112            ASSERT(blob);
  • trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp

    r127946 r141718  
    6060}
    6161
    62 static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value)
     62static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    6363{
    64     if (V8CanvasGradient::HasInstance(value))
     64    if (V8CanvasGradient::HasInstance(value, isolate))
    6565        return CanvasStyle::createFromGradient(V8CanvasGradient::toNative(v8::Handle<v8::Object>::Cast(value)));
    6666
    67     if (V8CanvasPattern::HasInstance(value))
     67    if (V8CanvasPattern::HasInstance(value, isolate))
    6868        return CanvasStyle::createFromPattern(V8CanvasPattern::toNative(v8::Handle<v8::Object>::Cast(value)));
    6969
     
    8383        impl->setStrokeColor(toWebCoreString(value));
    8484    else
    85         impl->setStrokeStyle(toCanvasStyle(value));
     85        impl->setStrokeStyle(toCanvasStyle(value, info.GetIsolate()));
    8686}
    8787
     
    9898        impl->setFillColor(toWebCoreString(value));
    9999    else
    100         impl->setFillStyle(toCanvasStyle(value));
     100        impl->setFillStyle(toCanvasStyle(value, info.GetIsolate()));
    101101}
    102102
  • trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp

    r138665 r141718  
    9292
    9393    Node* node = 0;
    94     if (V8Node::HasInstance(args[0]))
     94    if (V8Node::HasInstance(args[0], args.GetIsolate()))
    9595        node = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0]));
    9696
  • trunk/Source/WebCore/bindings/v8/custom/V8CryptoCustom.cpp

    r138298 r141718  
    4242
    4343    v8::Handle<v8::Value> buffer = args[0];
    44     if (!V8ArrayBufferView::HasInstance(buffer))
     44    if (!V8ArrayBufferView::HasInstance(buffer, args.GetIsolate()))
    4545        return throwTypeError("First argument is not an ArrayBufferView", args.GetIsolate());
    4646
  • trunk/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp

    r139601 r141718  
    4343{
    4444    HTMLFormElement* form = 0;
    45     if (args.Length() > 0 && V8HTMLFormElement::HasInstance(args[0]))
     45    if (args.Length() > 0 && V8HTMLFormElement::HasInstance(args[0], args.GetIsolate()))
    4646        form = V8HTMLFormElement::toNative(args[0]->ToObject());
    4747    RefPtr<DOMFormData> domFormData = DOMFormData::create(form);
     
    6262
    6363    v8::Handle<v8::Value> arg = args[1];
    64     if (V8Blob::HasInstance(arg)) {
     64    if (V8Blob::HasInstance(arg, args.GetIsolate())) {
    6565        v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
    6666        Blob* blob = V8Blob::toNative(object);
  • trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp

    r139601 r141718  
    4343        return wrapper;
    4444    }
    45     if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0]))
     45    if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolate()))
    4646        return throwTypeError(0, args.GetIsolate());
    4747    return constructWebGLArrayWithArrayBufferArgument<DataView, char>(args, &info, v8::kExternalByteArray, false);
  • trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp

    r138677 r141718  
    7171    String expression = toWebCoreString(args[0]);
    7272    RefPtr<Node> contextNode;
    73     if (V8Node::HasInstance(args[1]))
     73    if (V8Node::HasInstance(args[1], args.GetIsolate()))
    7474        contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1]));
    7575
     
    8080    int type = toInt32(args[3]);
    8181    RefPtr<XPathResult> inResult;
    82     if (V8XPathResult::HasInstance(args[4]))
     82    if (V8XPathResult::HasInstance(args[4], args.GetIsolate()))
    8383        inResult = V8XPathResult::toNative(v8::Handle<v8::Object>::Cast(args[4]));
    8484
  • trunk/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp

    r138665 r141718  
    3838    HTMLMediaElement* imp = V8HTMLMediaElement::toNative(info.Holder());
    3939    MediaController* controller = 0;
    40     if (V8MediaController::HasInstance(value))
     40    if (V8MediaController::HasInstance(value, info.GetIsolate()))
    4141        controller = V8MediaController::toNative(value->ToObject());
    4242   
  • trunk/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp

    r138677 r141718  
    9191v8::Handle<v8::Value> V8HTMLOptionsCollection::addCallback(const v8::Arguments& args)
    9292{
    93     if (!V8HTMLOptionElement::HasInstance(args[0]))
     93    if (!V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate()))
    9494        return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
    9595    HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder());
  • trunk/Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp

    r138665 r141718  
    7070v8::Handle<v8::Value> removeElement(HTMLSelectElement* imp, const v8::Arguments& args)
    7171{
    72     if (V8HTMLOptionElement::HasInstance(args[0])) {
     72    if (V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate())) {
    7373        HTMLOptionElement* element = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>::Cast(args[0]));
    7474        imp->remove(element->index());
Note: See TracChangeset for help on using the changeset viewer.