WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-86794-20120518110826.patch (text/plain), 14.92 KB, created by
Kentaro Hara
on 2012-05-17 19:08:27 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Kentaro Hara
Created:
2012-05-17 19:08:27 PDT
Size:
14.92 KB
patch
obsolete
>Subversion Revision: 117525 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d3fbb923997d193d8d35e242c84c7ca05af126e8..f1af325be0a67fb4b082476ec2c8a6adb2901686 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,41 @@ >+2012-05-17 Kentaro Hara <haraken@chromium.org> >+ >+ [V8][Refactoring] Remove V8Proxy::throwError(const char*, v8::Isolate* = 0) >+ https://bugs.webkit.org/show_bug.cgi?id=86794 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ As commented here (https://bugs.webkit.org/show_bug.cgi?id=84074#c5), >+ I am refactoring a series of confusing throwError()s. >+ This patch removes V8Proxy::throwError(const char*, v8::Isolate* = 0). >+ >+ No tests. No change in behavior. >+ >+ * bindings/v8/V8Utilities.cpp: >+ (WebCore::extractTransferables): >+ (WebCore::getMessagePortArray): >+ * bindings/v8/custom/V8ArrayBufferViewCustom.h: >+ (WebCore::constructWebGLArrayWithArrayBufferArgument): >+ (WebCore::constructWebGLArray): >+ * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp: >+ (WebCore::V8AudioBufferSourceNode::bufferAccessorSetter): >+ * bindings/v8/custom/V8ClipboardCustom.cpp: >+ (WebCore::V8Clipboard::setDragImageCallback): >+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp: >+ (WebCore::V8HTMLDocument::openCallback): >+ * bindings/v8/custom/V8HTMLInputElementCustom.cpp: >+ (WebCore::V8HTMLInputElement::selectionStartAccessorGetter): >+ (WebCore::V8HTMLInputElement::selectionStartAccessorSetter): >+ (WebCore::V8HTMLInputElement::selectionEndAccessorGetter): >+ (WebCore::V8HTMLInputElement::selectionEndAccessorSetter): >+ (WebCore::V8HTMLInputElement::selectionDirectionAccessorGetter): >+ (WebCore::V8HTMLInputElement::selectionDirectionAccessorSetter): >+ (WebCore::V8HTMLInputElement::setSelectionRangeCallback): >+ * bindings/v8/custom/V8HTMLMediaElementCustom.cpp: >+ (WebCore::V8HTMLMediaElement::controllerAccessorSetter): >+ * bindings/v8/custom/V8InjectedScriptHostCustom.cpp: >+ (WebCore::V8InjectedScriptHost::inspectedObjectCallback): >+ > 2012-05-17 Michael Moss <mmoss@chromium.org> > > Linux amd64 platform reported as i686 >diff --git a/Source/WebCore/bindings/v8/V8Proxy.h b/Source/WebCore/bindings/v8/V8Proxy.h >index 5ecb63977a157ffdedbe2f45f7af4944c5e02b04..41dc85fa9e3160d16eb644e5d4c85562f3dd0752 100644 >--- a/Source/WebCore/bindings/v8/V8Proxy.h >+++ b/Source/WebCore/bindings/v8/V8Proxy.h >@@ -325,13 +325,6 @@ namespace WebCore { > return v8::Local<v8::Boolean>(); > } > >- inline v8::Handle<v8::Primitive> throwError(const char* message, v8::Isolate* isolate = 0) >- { >- if (!v8::V8::IsExecutionTerminating()) >- V8Proxy::throwError(V8Proxy::TypeError, message, isolate); >- return v8::Undefined(); >- } >- > inline v8::Handle<v8::Primitive> throwError(const char* message, V8Proxy::ErrorType type, v8::Isolate* isolate = 0) > { > if (!v8::V8::IsExecutionTerminating()) >diff --git a/Source/WebCore/bindings/v8/V8Utilities.cpp b/Source/WebCore/bindings/v8/V8Utilities.cpp >index d39049c8f0406481db99724e08918c6fd15b2d3d..6364efc6a74f332767ec9418cc92a30e482ac17e 100644 >--- a/Source/WebCore/bindings/v8/V8Utilities.cpp >+++ b/Source/WebCore/bindings/v8/V8Utilities.cpp >@@ -94,7 +94,7 @@ bool extractTransferables(v8::Local<v8::Value> value, MessagePortArray& ports, A > } > > if (!value->IsObject()) { >- throwError("TransferArray argument must be an object"); >+ V8Proxy::throwTypeError("TransferArray argument must be an object"); > return false; > } > uint32_t length = 0; >@@ -107,7 +107,7 @@ bool extractTransferables(v8::Local<v8::Value> value, MessagePortArray& ports, A > // Sequence-type object - get the length attribute > v8::Local<v8::Value> sequenceLength = transferrables->Get(v8::String::New("length")); > if (!sequenceLength->IsNumber()) { >- throwError("TransferArray argument has no length attribute"); >+ V8Proxy::throwTypeError("TransferArray argument has no length attribute"); > return false; > } > length = sequenceLength->Uint32Value(); >@@ -127,7 +127,7 @@ bool extractTransferables(v8::Local<v8::Value> value, MessagePortArray& ports, A > else if (V8ArrayBuffer::HasInstance(transferrable)) > arrayBuffers.append(V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(transferrable))); > else { >- throwError("TransferArray argument must contain only Transferables"); >+ V8Proxy::throwTypeError("TransferArray argument must contain only Transferables"); > return false; > } > } >@@ -141,7 +141,7 @@ bool getMessagePortArray(v8::Local<v8::Value> value, MessagePortArray& ports) > if (!result) > return false; > if (arrayBuffers.size() > 0) { >- throwError("MessagePortArray argument must contain only MessagePorts"); >+ V8Proxy::throwTypeError("MessagePortArray argument must contain only MessagePorts"); > return false; > } > return true; >diff --git a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h >index 4c0eb86736a599aa0c4d7a2f1b7481ad9bec10f2..e3c23124218fdc1e211dd313ee7ab0a8163d9128 100644 >--- a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h >+++ b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h >@@ -60,20 +60,20 @@ v8::Handle<v8::Value> constructWebGLArrayWithArrayBufferArgument(const v8::Argum > { > ArrayBuffer* buf = V8ArrayBuffer::toNative(args[0]->ToObject()); > if (!buf) >- return throwError("Could not convert argument 0 to a ArrayBuffer"); >+ return V8Proxy::throwTypeError("Could not convert argument 0 to a ArrayBuffer"); > bool ok; > uint32_t offset = 0; > int argLen = args.Length(); > if (argLen > 1) { > offset = toUInt32(args[1], ok); > if (!ok) >- return throwError("Could not convert argument 1 to a number"); >+ return V8Proxy::throwTypeError("Could not convert argument 1 to a number"); > } > uint32_t length = 0; > if (argLen > 2) { > length = toUInt32(args[2], ok); > if (!ok) >- return throwError("Could not convert argument 2 to a number"); >+ return V8Proxy::throwTypeError("Could not convert argument 2 to a number"); > } else { > if ((buf->byteLength() - offset) % sizeof(ElementType)) > return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size."); >@@ -153,7 +153,7 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType > if (args[0]->IsObject()) { > srcArray = args[0]->ToObject(); > if (srcArray.IsEmpty()) >- return throwError("Could not convert argument 0 to an array"); >+ return V8Proxy::throwTypeError("Could not convert argument 0 to an array"); > len = toUInt32(srcArray->Get(v8::String::New("length"))); > doInstantiation = true; > } else { >diff --git a/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp b/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp >index 8d870be1148c68d80f9f83a4b42b223fc44bae66..79e02e8a04bac6b24d674731567695f0463230d0 100644 >--- a/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp >@@ -47,13 +47,13 @@ void V8AudioBufferSourceNode::bufferAccessorSetter(v8::Local<v8::String> name, v > if (V8AudioBuffer::HasInstance(value)) { > buffer = V8AudioBuffer::toNative(value->ToObject()); > if (buffer && !imp->setBuffer(buffer)) { >- throwError("AudioBuffer unsupported number of channels"); >+ V8Proxy::throwTypeError("AudioBuffer unsupported number of channels"); > return; > } > } > > if (!buffer) { >- throwError("Value is not of type AudioBuffer"); >+ V8Proxy::throwTypeError("Value is not of type AudioBuffer"); > return; > } > } >diff --git a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp >index c77d2b6a35c381a35f7b6caeaf46c80a09a24b92..fbc3d01912853ee691702458099e609055b86b25 100644 >--- a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp >@@ -99,7 +99,7 @@ v8::Handle<v8::Value> V8Clipboard::setDragImageCallback(const v8::Arguments& arg > node = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])); > > if (!node || !node->isElementNode()) >- return throwError("setDragImageFromElement: Invalid first argument"); >+ return V8Proxy::throwTypeError("setDragImageFromElement: Invalid first argument"); > > if (static_cast<Element*>(node)->hasLocalName(HTMLNames::imgTag) && !node->inDocument()) > clipboard->setDragImage(static_cast<HTMLImageElement*>(node)->cachedImage(), IntPoint(x, y)); >diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp >index b5d85752547e6d88e0ea4b1e3db824e255dceb08..06e165e499a4a750911508d0b73949589d076e7c 100644 >--- a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp >@@ -149,7 +149,7 @@ v8::Handle<v8::Value> V8HTMLDocument::openCallback(const v8::Arguments& args) > v8::Local<v8::Value> function = global->Get(v8::String::New("open")); > // If the open property is not a function throw a type error. > if (!function->IsFunction()) { >- throwError("open is not a function"); >+ V8Proxy::throwTypeError("open is not a function"); > return v8::Undefined(); > } > // Wrap up the arguments and call the function. >diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp >index c74d3f6d205edb8e52154c1f8a6451c3432dabba..65686546e49a0ac8755b22f314084d0939d27c2a 100644 >--- a/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp >@@ -45,7 +45,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::selectionStartAccessorGetter(v8::Local > HTMLInputElement* imp = V8HTMLInputElement::toNative(holder); > > if (!imp->canHaveSelection()) >- return throwError("Accessing selectionStart on an input element that cannot have a selection."); >+ return V8Proxy::throwTypeError("Accessing selectionStart on an input element that cannot have a selection."); > > int v = imp->selectionStart(); > return v8::Integer::New(v); >@@ -58,7 +58,7 @@ void V8HTMLInputElement::selectionStartAccessorSetter(v8::Local<v8::String> name > HTMLInputElement* imp = V8HTMLInputElement::toNative(holder); > > if (!imp->canHaveSelection()) { >- throwError("Accessing selectionStart on an input element that cannot have a selection."); >+ V8Proxy::throwTypeError("Accessing selectionStart on an input element that cannot have a selection."); > return; > } > imp->setSelectionStart(value->Int32Value()); >@@ -71,7 +71,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::selectionEndAccessorGetter(v8::Local<v > HTMLInputElement* imp = V8HTMLInputElement::toNative(holder); > > if (!imp->canHaveSelection()) >- return throwError("Accessing selectionEnd on an input element that cannot have a selection."); >+ return V8Proxy::throwTypeError("Accessing selectionEnd on an input element that cannot have a selection."); > > int v = imp->selectionEnd(); > return v8::Integer::New(v); >@@ -84,7 +84,7 @@ void V8HTMLInputElement::selectionEndAccessorSetter(v8::Local<v8::String> name, > HTMLInputElement* imp = V8HTMLInputElement::toNative(holder); > > if (!imp->canHaveSelection()) { >- throwError("Accessing selectionEnd on an input element that cannot have a selection."); >+ V8Proxy::throwTypeError("Accessing selectionEnd on an input element that cannot have a selection."); > return; > } > >@@ -98,7 +98,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::selectionDirectionAccessorGetter(v8::L > HTMLInputElement* imp = V8HTMLInputElement::toNative(holder); > > if (!imp->canHaveSelection()) >- return throwError("Accessing selectionDirection on an input element that cannot have a selection."); >+ return V8Proxy::throwTypeError("Accessing selectionDirection on an input element that cannot have a selection."); > > return v8String(imp->selectionDirection()); > } >@@ -110,7 +110,7 @@ void V8HTMLInputElement::selectionDirectionAccessorSetter(v8::Local<v8::String> > HTMLInputElement* imp = V8HTMLInputElement::toNative(holder); > > if (!imp->canHaveSelection()) { >- throwError("Accessing selectionDirection on an input element that cannot have a selection."); >+ V8Proxy::throwTypeError("Accessing selectionDirection on an input element that cannot have a selection."); > return; > } > >@@ -124,7 +124,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::setSelectionRangeCallback(const v8::Ar > HTMLInputElement* imp = V8HTMLInputElement::toNative(holder); > > if (!imp->canHaveSelection()) >- return throwError("Calling setSelectionRange on an input element that cannot have a selection."); >+ return V8Proxy::throwTypeError("Calling setSelectionRange on an input element that cannot have a selection."); > > int start = args[0]->Int32Value(); > int end = args[1]->Int32Value(); >diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp >index e92504cc6ee5c74ea4826bac8d1a3e0a87f45e44..7cb2276d8d9ccd21275a18121e17e16a9c003aaa 100644 >--- a/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp >@@ -43,7 +43,7 @@ void V8HTMLMediaElement::controllerAccessorSetter(v8::Local<v8::String> name, v8 > controller = V8MediaController::toNative(value->ToObject()); > > if (!controller) { >- throwError("Value is not of type MediaController"); >+ V8Proxy::throwTypeError("Value is not of type MediaController"); > return; > } > >diff --git a/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp >index 87d195acea39fcae6ba780b0216faf0133ea3ba0..9f9780c7d99b92cdae6f742566ea05960c39092d 100644 >--- a/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp >@@ -83,7 +83,7 @@ v8::Handle<v8::Value> V8InjectedScriptHost::inspectedObjectCallback(const v8::Ar > return v8::Undefined(); > > if (!args[0]->IsInt32()) { >- throwError("argument has to be an integer"); >+ V8Proxy::throwTypeError("argument has to be an integer"); > return v8::Undefined(); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 86794
: 142609