Diff
Modified: trunk/Source/WebCore/ChangeLog (141717 => 141718)
--- trunk/Source/WebCore/ChangeLog 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/ChangeLog 2013-02-03 23:26:25 UTC (rev 141718)
@@ -1,3 +1,42 @@
+2013-02-03 Kentaro Hara <hara...@chromium.org>
+
+ [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):
+
2013-02-03 Mike West <mk...@chromium.org>
Cleanup: 'ExceptionCode& ec', not 'ExceptionCode &ec'.
Modified: trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h 2013-02-03 23:26:25 UTC (rev 141718)
@@ -139,12 +139,12 @@
}
// See whether the first argument is a ArrayBuffer.
- if (V8ArrayBuffer::HasInstance(args[0]))
+ if (V8ArrayBuffer::HasInstance(args[0], args.GetIsolate()))
return constructWebGLArrayWithArrayBufferArgument<ArrayClass, ElementType>(args, type, arrayType, true);
// See whether the first argument is the same type as impl. In that case,
// we can simply memcpy data from source to impl.
- if (_javascript_WrapperArrayType::HasInstance(args[0])) {
+ if (_javascript_WrapperArrayType::HasInstance(args[0], args.GetIsolate())) {
ArrayClass* source = _javascript_WrapperArrayType::toNative(args[0]->ToObject());
uint32_t length = source->length();
@@ -238,7 +238,7 @@
CPlusPlusArrayType* impl = _javascript_WrapperArrayType::toNative(args.Holder());
- if (_javascript_WrapperArrayType::HasInstance(args[0])) {
+ if (_javascript_WrapperArrayType::HasInstance(args[0], args.GetIsolate())) {
// void set(in WebGL<T>Array array, [Optional] in unsigned long offset);
CPlusPlusArrayType* src = ""
uint32_t offset = 0;
Modified: trunk/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -42,7 +42,7 @@
AudioBufferSourceNode* imp = V8AudioBufferSourceNode::toNative(holder);
AudioBuffer* buffer = 0;
- if (V8AudioBuffer::HasInstance(value)) {
+ if (V8AudioBuffer::HasInstance(value, info.GetIsolate())) {
buffer = V8AudioBuffer::toNative(value->ToObject());
if (buffer && !imp->setBuffer(buffer)) {
throwTypeError("AudioBuffer unsupported number of channels", info.GetIsolate());
Modified: trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -97,17 +97,17 @@
v8::Local<v8::Value> item = blobParts->Get(v8::Uint32::New(i));
ASSERT(!item.IsEmpty());
#if ENABLE(BLOB)
- if (V8ArrayBuffer::HasInstance(item)) {
+ if (V8ArrayBuffer::HasInstance(item, args.GetIsolate())) {
ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(item));
ASSERT(arrayBuffer);
blobBuilder.append(context, arrayBuffer);
- } else if (V8ArrayBufferView::HasInstance(item)) {
+ } else if (V8ArrayBufferView::HasInstance(item, args.GetIsolate())) {
ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(item));
ASSERT(arrayBufferView);
blobBuilder.append(arrayBufferView);
} else
#endif
- if (V8Blob::HasInstance(item)) {
+ if (V8Blob::HasInstance(item, args.GetIsolate())) {
Blob* blob = V8Blob::toNative(v8::Handle<v8::Object>::Cast(item));
ASSERT(blob);
blobBuilder.append(blob);
Modified: trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -59,12 +59,12 @@
return v8String(style->color(), isolate);
}
-static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value)
+static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value, v8::Isolate* isolate)
{
- if (V8CanvasGradient::HasInstance(value))
+ if (V8CanvasGradient::HasInstance(value, isolate))
return CanvasStyle::createFromGradient(V8CanvasGradient::toNative(v8::Handle<v8::Object>::Cast(value)));
- if (V8CanvasPattern::HasInstance(value))
+ if (V8CanvasPattern::HasInstance(value, isolate))
return CanvasStyle::createFromPattern(V8CanvasPattern::toNative(v8::Handle<v8::Object>::Cast(value)));
return 0;
@@ -82,7 +82,7 @@
if (value->IsString())
impl->setStrokeColor(toWebCoreString(value));
else
- impl->setStrokeStyle(toCanvasStyle(value));
+ impl->setStrokeStyle(toCanvasStyle(value, info.GetIsolate()));
}
v8::Handle<v8::Value> V8CanvasRenderingContext2D::fillStyleAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
@@ -97,7 +97,7 @@
if (value->IsString())
impl->setFillColor(toWebCoreString(value));
else
- impl->setFillStyle(toCanvasStyle(value));
+ impl->setFillStyle(toCanvasStyle(value, info.GetIsolate()));
}
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -91,7 +91,7 @@
int y = toInt32(args[2]);
Node* node = 0;
- if (V8Node::HasInstance(args[0]))
+ if (V8Node::HasInstance(args[0], args.GetIsolate()))
node = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0]));
if (!node || !node->isElementNode())
Modified: trunk/Source/WebCore/bindings/v8/custom/V8CryptoCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8CryptoCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CryptoCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -41,7 +41,7 @@
return throwNotEnoughArgumentsError(args.GetIsolate());
v8::Handle<v8::Value> buffer = args[0];
- if (!V8ArrayBufferView::HasInstance(buffer))
+ if (!V8ArrayBufferView::HasInstance(buffer, args.GetIsolate()))
return throwTypeError("First argument is not an ArrayBufferView", args.GetIsolate());
ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(buffer));
Modified: trunk/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -42,7 +42,7 @@
v8::Handle<v8::Value> V8DOMFormData::constructorCallbackCustom(const v8::Arguments& args)
{
HTMLFormElement* form = 0;
- if (args.Length() > 0 && V8HTMLFormElement::HasInstance(args[0]))
+ if (args.Length() > 0 && V8HTMLFormElement::HasInstance(args[0], args.GetIsolate()))
form = V8HTMLFormElement::toNative(args[0]->ToObject());
RefPtr<DOMFormData> domFormData = DOMFormData::create(form);
@@ -61,7 +61,7 @@
String name = toWebCoreStringWithNullCheck(args[0]);
v8::Handle<v8::Value> arg = args[1];
- if (V8Blob::HasInstance(arg)) {
+ if (V8Blob::HasInstance(arg, args.GetIsolate())) {
v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
Blob* blob = V8Blob::toNative(object);
ASSERT(blob);
Modified: trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -42,7 +42,7 @@
V8DOMWrapper::associateObjectWithWrapper(dataView.release(), &info, wrapper, args.GetIsolate());
return wrapper;
}
- if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0]))
+ if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolate()))
return throwTypeError(0, args.GetIsolate());
return constructWebGLArrayWithArrayBufferArgument<DataView, char>(args, &info, v8::kExternalByteArray, false);
}
Modified: trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -70,7 +70,7 @@
ExceptionCode ec = 0;
String _expression_ = toWebCoreString(args[0]);
RefPtr<Node> contextNode;
- if (V8Node::HasInstance(args[1]))
+ if (V8Node::HasInstance(args[1], args.GetIsolate()))
contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1]));
RefPtr<XPathNSResolver> resolver = toXPathNSResolver(args[2]);
@@ -79,7 +79,7 @@
int type = toInt32(args[3]);
RefPtr<XPathResult> inResult;
- if (V8XPathResult::HasInstance(args[4]))
+ if (V8XPathResult::HasInstance(args[4], args.GetIsolate()))
inResult = V8XPathResult::toNative(v8::Handle<v8::Object>::Cast(args[4]));
V8TRYCATCH(RefPtr<XPathResult>, result, document->evaluate(_expression_, contextNode.get(), resolver.get(), type, inResult.get(), ec));
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -37,7 +37,7 @@
{
HTMLMediaElement* imp = V8HTMLMediaElement::toNative(info.Holder());
MediaController* controller = 0;
- if (V8MediaController::HasInstance(value))
+ if (V8MediaController::HasInstance(value, info.GetIsolate()))
controller = V8MediaController::toNative(value->ToObject());
if (!controller) {
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -90,7 +90,7 @@
v8::Handle<v8::Value> V8HTMLOptionsCollection::addCallback(const v8::Arguments& args)
{
- if (!V8HTMLOptionElement::HasInstance(args[0]))
+ if (!V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate()))
return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder());
HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(args[0])));
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp (141717 => 141718)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp 2013-02-03 18:35:51 UTC (rev 141717)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp 2013-02-03 23:26:25 UTC (rev 141718)
@@ -69,7 +69,7 @@
v8::Handle<v8::Value> removeElement(HTMLSelectElement* imp, const v8::Arguments& args)
{
- if (V8HTMLOptionElement::HasInstance(args[0])) {
+ if (V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate())) {
HTMLOptionElement* element = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>::Cast(args[0]));
imp->remove(element->index());
return v8::Undefined();