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-86579-20120516153953.patch (text/plain), 20.64 KB, created by
Kentaro Hara
on 2012-05-15 23:39:55 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Kentaro Hara
Created:
2012-05-15 23:39:55 PDT
Size:
20.64 KB
patch
obsolete
>Subversion Revision: 117218 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2645cefd14c56415536f62e3e86d05649270e2f4..bc64d90e63af8807ce1e803919d5c34b46b27c58 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,53 @@ >+2012-05-15 Kentaro Hara <haraken@chromium.org> >+ >+ [V8][Refactoring] Replace throwError("message", XXXError) >+ with throwError(XXXError, "message") >+ https://bugs.webkit.org/show_bug.cgi?id=86579 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This is one of a series of refactoring commented in >+ https://bugs.webkit.org/show_bug.cgi?id=84074#c5 >+ >+ Currently there are two equivalent throwError()s; i.e. throwError("message", XXXError) >+ and throwError(XXXError, "message"). In this bug we replace >+ throwError("message", XXXError) with throwError(XXXError, "message") >+ (except for the case where XXXError == TypeError. This is because >+ throwError("message", TypeError) will be replaced with throwTypeError("message") >+ in a follow-up patch). >+ >+ No tests. No change in behavior. >+ >+ * bindings/v8/V8NPObject.cpp: >+ (WebCore::npObjectInvokeImpl): >+ (WebCore::npObjectGetProperty): >+ (WebCore::npObjectSetProperty): >+ (WebCore::npObjectPropertyEnumerator): >+ * bindings/v8/V8Proxy.cpp: >+ (WebCore::handleMaxRecursionDepthExceeded): >+ * bindings/v8/custom/V8ArrayBufferCustom.cpp: >+ (WebCore::V8ArrayBuffer::constructorCallback): >+ * bindings/v8/custom/V8ArrayBufferViewCustom.h: >+ (WebCore::constructWebGLArrayWithArrayBufferArgument): >+ (WebCore::constructWebGLArray): >+ * bindings/v8/custom/V8AudioContextCustom.cpp: >+ (WebCore::V8AudioContext::constructorCallback): >+ * bindings/v8/custom/V8BlobCustom.cpp: >+ (WebCore::V8Blob::constructorCallback): >+ * bindings/v8/custom/V8ClipboardCustom.cpp: >+ (WebCore::V8Clipboard::clearDataCallback): >+ (WebCore::V8Clipboard::setDragImageCallback): >+ * bindings/v8/custom/V8DOMFormDataCustom.cpp: >+ (WebCore::V8DOMFormData::appendCallback): >+ * bindings/v8/custom/V8HTMLImageElementConstructor.cpp: >+ (WebCore::v8HTMLImageElementConstructorCallback): >+ * bindings/v8/custom/V8WebKitMutationObserverCustom.cpp: >+ (WebCore::V8WebKitMutationObserver::constructorCallback): >+ * bindings/v8/custom/V8WebSocketCustom.cpp: >+ (WebCore::V8WebSocket::constructorCallback): >+ * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp: >+ (WebCore::V8XMLHttpRequest::constructorCallback): >+ > 2012-05-15 Igor Oliveira <igor.o@sisa.samsung.com> > > regression(111639): Issue with simultaneous CSS animations >diff --git a/Source/WebCore/bindings/v8/V8NPObject.cpp b/Source/WebCore/bindings/v8/V8NPObject.cpp >index 0d1c03cfc11447d085b27eae9f5984dc06a719ad..5a58d827226a9276fa87bd874199ba19c358eea3 100644 >--- a/Source/WebCore/bindings/v8/V8NPObject.cpp >+++ b/Source/WebCore/bindings/v8/V8NPObject.cpp >@@ -92,14 +92,14 @@ static v8::Handle<v8::Value> npObjectInvokeImpl(const v8::Arguments& args, Invok > // The holder object is not a subtype of HTMLPlugInElement, it must be an NPObject which has three > // internal fields. > if (args.Holder()->InternalFieldCount() != npObjectInternalFieldCount) >- return throwError("NPMethod called on non-NPObject", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "NPMethod called on non-NPObject"); > > npObject = v8ObjectToNPObject(args.Holder()); > } > > // Verify that our wrapper wasn't using a NPObject which has already been deleted. > if (!npObject || !_NPN_IsAlive(npObject)) >- return throwError("NPObject deleted", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted"); > > // Wrap up parameters. > int numArgs = args.Length(); >@@ -133,7 +133,7 @@ static v8::Handle<v8::Value> npObjectInvokeImpl(const v8::Arguments& args, Invok > } > > if (!retval) >- throwError("Error calling method on NPObject.", V8Proxy::GeneralError); >+ V8Proxy::throwError(V8Proxy::GeneralError, "Error calling method on NPObject."); > > for (int i = 0; i < numArgs; i++) > _NPN_ReleaseVariantValue(&npArgs[i]); >@@ -190,12 +190,12 @@ static v8::Handle<v8::Value> npObjectGetProperty(v8::Local<v8::Object> self, NPI > // Verify that our wrapper wasn't using a NPObject which > // has already been deleted. > if (!npObject || !_NPN_IsAlive(npObject)) >- return throwError("NPObject deleted", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted"); > > > if (npObject->_class->hasProperty && npObject->_class->getProperty && npObject->_class->hasProperty(npObject, identifier)) { > if (!_NPN_IsAlive(npObject)) >- return throwError("NPObject deleted", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted"); > > NPVariant result; > VOID_TO_NPVARIANT(result); >@@ -211,11 +211,11 @@ static v8::Handle<v8::Value> npObjectGetProperty(v8::Local<v8::Object> self, NPI > } > > if (!_NPN_IsAlive(npObject)) >- return throwError("NPObject deleted", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted"); > > if (key->IsString() && npObject->_class->hasMethod && npObject->_class->hasMethod(npObject, identifier)) { > if (!_NPN_IsAlive(npObject)) >- return throwError("NPObject deleted", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted"); > > PrivateIdentifier* id = static_cast<PrivateIdentifier*>(identifier); > v8::Persistent<v8::FunctionTemplate> functionTemplate = staticTemplateMap().get(id); >@@ -273,13 +273,13 @@ static v8::Handle<v8::Value> npObjectSetProperty(v8::Local<v8::Object> self, NPI > > // Verify that our wrapper wasn't using a NPObject which has already been deleted. > if (!npObject || !_NPN_IsAlive(npObject)) { >- throwError("NPObject deleted", V8Proxy::ReferenceError); >+ V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted"); > return value; // Intercepted, but an exception was thrown. > } > > if (npObject->_class->hasProperty && npObject->_class->setProperty && npObject->_class->hasProperty(npObject, identifier)) { > if (!_NPN_IsAlive(npObject)) >- return throwError("NPObject deleted", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted"); > > NPVariant npValue; > VOID_TO_NPVARIANT(npValue); >@@ -325,7 +325,7 @@ v8::Handle<v8::Array> npObjectPropertyEnumerator(const v8::AccessorInfo& info, b > // Verify that our wrapper wasn't using a NPObject which > // has already been deleted. > if (!npObject || !_NPN_IsAlive(npObject)) >- throwError("NPObject deleted", V8Proxy::ReferenceError); >+ V8Proxy::throwError(V8Proxy::ReferenceError, "NPObject deleted"); > > if (NP_CLASS_STRUCT_VERSION_HAS_ENUM(npObject->_class) && npObject->_class->enumerate) { > uint32_t count; >diff --git a/Source/WebCore/bindings/v8/V8Proxy.cpp b/Source/WebCore/bindings/v8/V8Proxy.cpp >index db733898b26fa9b34bd8751426c68f5fcd7d5c1e..5c9ecce853ff41e91c7951b2f69783a9377deed6 100644 >--- a/Source/WebCore/bindings/v8/V8Proxy.cpp >+++ b/Source/WebCore/bindings/v8/V8Proxy.cpp >@@ -160,7 +160,7 @@ static void handleFatalErrorInV8() > > static v8::Local<v8::Value> handleMaxRecursionDepthExceeded() > { >- throwError("Maximum call stack size exceeded.", V8Proxy::RangeError); >+ V8Proxy::throwError(V8Proxy::RangeError, "Maximum call stack size exceeded."); > return v8::Local<v8::Value>(); > } > >diff --git a/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp >index cf690fd2bcae1dece8aea41d67ea77e0633362fa..b654de7810b30cc67bfa25df08ce8bd5c034348e 100644 >--- a/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp >@@ -70,7 +70,7 @@ v8::Handle<v8::Value> V8ArrayBuffer::constructorCallback(const v8::Arguments& ar > if (length >= 0) > buffer = ArrayBuffer::create(static_cast<unsigned>(length), 1); > if (!buffer.get()) >- return throwError("ArrayBuffer size is not a small enough positive integer.", V8Proxy::RangeError); >+ return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer size is not a small enough positive integer."); > // Transform the holder into a wrapper object for the array. > V8DOMWrapper::setDOMWrapper(args.Holder(), &info, buffer.get()); > V8DOMWrapper::setJSWrapperForDOMObject(buffer.release(), v8::Persistent<v8::Object>::New(args.Holder())); >diff --git a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h >index a0fc5aed52e41f4af81634aa811e2033340d9e07..67536de621541570f260887b24f53def900189ba 100644 >--- a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h >+++ b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h >@@ -76,7 +76,7 @@ v8::Handle<v8::Value> constructWebGLArrayWithArrayBufferArgument(const v8::Argum > return throwError("Could not convert argument 2 to a number"); > } else { > if ((buf->byteLength() - offset) % sizeof(ElementType)) >- return throwError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.", V8Proxy::RangeError); >+ return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size."); > length = (buf->byteLength() - offset) / sizeof(ElementType); > } > RefPtr<ArrayClass> array = ArrayClass::create(buf, offset, length); >@@ -169,7 +169,7 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType > if (doInstantiation) > array = ArrayClass::create(len); > if (!array.get()) >- return throwError("ArrayBufferView size is not a small enough positive integer.", V8Proxy::RangeError); >+ return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBufferView size is not a small enough positive integer."); > > > // Transform the holder into a wrapper object for the array. >diff --git a/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp >index ec6338d42a29ead8c251aa452b01887962ab75dd..dc532f7a464056b9cbc98a4aa0ddf6b6cbf095cf 100644 >--- a/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp >@@ -51,11 +51,11 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a > > Frame* frame = V8Proxy::retrieveFrameForCurrentContext(); > if (!frame) >- return throwError("AudioContext constructor associated frame is unavailable", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "AudioContext constructor associated frame is unavailable"); > > Document* document = frame->document(); > if (!document) >- return throwError("AudioContext constructor associated document is unavailable", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "AudioContext constructor associated document is unavailable"); > > RefPtr<AudioContext> audioContext; > >@@ -66,7 +66,7 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a > if (ec) > return throwError(ec); > if (!audioContext.get()) >- return throwError("audio resources unavailable for AudioContext construction", V8Proxy::SyntaxError); >+ return V8Proxy::throwError(V8Proxy::SyntaxError, "audio resources unavailable for AudioContext construction"); > } else { > // Constructor for offline (render-target) AudioContext which renders into an AudioBuffer. > // new AudioContext(in unsigned long numberOfChannels, in unsigned long numberOfFrames, in float sampleRate); >@@ -77,15 +77,15 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a > > int32_t numberOfChannels = toInt32(args[0], ok); > if (!ok || numberOfChannels <= 0 || numberOfChannels > 10) >- return throwError("Invalid number of channels", V8Proxy::SyntaxError); >+ return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid number of channels"); > > int32_t numberOfFrames = toInt32(args[1], ok); > if (!ok || numberOfFrames <= 0) >- return throwError("Invalid number of frames", V8Proxy::SyntaxError); >+ return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid number of frames"); > > float sampleRate = toFloat(args[2]); > if (sampleRate <= 0) >- return throwError("Invalid sample rate", V8Proxy::SyntaxError); >+ return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid sample rate"); > > ExceptionCode ec = 0; > audioContext = AudioContext::createOfflineContext(document, numberOfChannels, numberOfFrames, sampleRate, ec); >@@ -94,7 +94,7 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a > } > > if (!audioContext.get()) >- return throwError("Error creating AudioContext", V8Proxy::SyntaxError); >+ return V8Proxy::throwError(V8Proxy::SyntaxError, "Error creating AudioContext"); > > // Transform the holder into a wrapper object for the audio context. > V8DOMWrapper::setDOMWrapper(args.Holder(), &info, audioContext.get()); >diff --git a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp >index 50b4873b79a64f476bf6f155ef196522caa36dcb..0c4d6d83c33b357d23495bb485d369987c4faaf3 100644 >--- a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp >@@ -68,7 +68,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args) > // Get the script execution context. > ScriptExecutionContext* context = getScriptExecutionContext(); > if (!context) >- return throwError("Blob constructor associated document is unavailable", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "Blob constructor associated document is unavailable"); > > if (!args.Length()) { > RefPtr<Blob> blob = Blob::create(); >diff --git a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp >index b336610644ed0d71f94e498671367de9befa89ea..c77d2b6a35c381a35f7b6caeaf46c80a09a24b92 100644 >--- a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp >@@ -73,7 +73,7 @@ v8::Handle<v8::Value> V8Clipboard::clearDataCallback(const v8::Arguments& args) > } > > if (args.Length() != 1) >- return throwError("clearData: Invalid number of arguments", V8Proxy::SyntaxError); >+ return V8Proxy::throwError(V8Proxy::SyntaxError, "clearData: Invalid number of arguments"); > > String type = toWebCoreString(args[0]); > clipboard->clearData(type); >@@ -89,7 +89,7 @@ v8::Handle<v8::Value> V8Clipboard::setDragImageCallback(const v8::Arguments& arg > return v8::Undefined(); > > if (args.Length() != 3) >- return throwError("setDragImage: Invalid number of arguments", V8Proxy::SyntaxError); >+ return V8Proxy::throwError(V8Proxy::SyntaxError, "setDragImage: Invalid number of arguments"); > > int x = toInt32(args[1]); > int y = toInt32(args[2]); >diff --git a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp >index a8d077dc5d597b3486c32e9379bb6a54f8ef8c7a..cd6e27ea2bcad94c597c33a994c093ec55fe8a9d 100644 >--- a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp >@@ -65,7 +65,7 @@ v8::Handle<v8::Value> V8DOMFormData::appendCallback(const v8::Arguments& args) > INC_STATS("DOM.FormData.append()"); > > if (args.Length() < 2) >- return throwError("Not enough arguments", V8Proxy::SyntaxError); >+ return V8Proxy::throwError(V8Proxy::SyntaxError, "Not enough arguments"); > > DOMFormData* domFormData = V8DOMFormData::toNative(args.Holder()); > >diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp >index 8c73a38e74fd01cbee2760b905b4f3835c21cba5..4e33a2af31968b4ea9374043c6e966e2c71cff96 100644 >--- a/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp >@@ -58,11 +58,11 @@ static v8::Handle<v8::Value> v8HTMLImageElementConstructorCallback(const v8::Arg > > Frame* frame = V8Proxy::retrieveFrameForCurrentContext(); > if (!frame) >- return throwError("Image constructor associated frame is unavailable", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "Image constructor associated frame is unavailable"); > > Document* document = frame->document(); > if (!document) >- return throwError("Image constructor associated document is unavailable", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "Image constructor associated document is unavailable"); > > // Make sure the document is added to the DOM Node map. Otherwise, the HTMLImageElement instance > // may end up being the only node in the map and get garbage-ccollected prematurely. >diff --git a/Source/WebCore/bindings/v8/custom/V8WebKitMutationObserverCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebKitMutationObserverCustom.cpp >index e75b94476b265db2eebb9e171405078a5239b87a..38b10cdfda3c7850fc2647e1d0df389668a9a527 100644 >--- a/Source/WebCore/bindings/v8/custom/V8WebKitMutationObserverCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8WebKitMutationObserverCustom.cpp >@@ -69,7 +69,7 @@ v8::Handle<v8::Value> V8WebKitMutationObserver::constructorCallback(const v8::Ar > > ScriptExecutionContext* context = getScriptExecutionContext(); > if (!context) >- return throwError("WebKitMutationObserver constructor's associated frame unavailable", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "WebKitMutationObserver constructor's associated frame unavailable"); > > RefPtr<MutationCallback> callback = V8MutationCallback::create(arg, context); > RefPtr<WebKitMutationObserver> observer = WebKitMutationObserver::create(callback.release()); >diff --git a/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp >index ae12b6fee8a1f56b795cad235a2af724a8492b89..a7c1516d9deeebd78c6c8e71d3d1c13b33980c6f 100644 >--- a/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp >@@ -69,12 +69,12 @@ v8::Handle<v8::Value> V8WebSocket::constructorCallback(const v8::Arguments& args > if (tryCatch.HasCaught()) > return throwError(tryCatch.Exception()); > if (urlstring.IsEmpty()) >- return throwError("Empty URL", V8Proxy::SyntaxError); >+ return V8Proxy::throwError(V8Proxy::SyntaxError, "Empty URL"); > > // Get the script execution context. > ScriptExecutionContext* context = getScriptExecutionContext(); > if (!context) >- return throwError("WebSocket constructor's associated frame is not available", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "WebSocket constructor's associated frame is not available"); > > const KURL& url = context->completeURL(toWebCoreString(urlstring)); > >diff --git a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp >index 71d7dd286552c4be959233c31d1278e170be230d..641a689a0455ce837f668ab38cef900ae190cbff 100644 >--- a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp >@@ -57,7 +57,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::constructorCallback(const v8::Arguments& > // Allocate a XMLHttpRequest object as its internal field. > ScriptExecutionContext* context = getScriptExecutionContext(); > if (!context) >- return throwError("XMLHttpRequest constructor's associated context is not available", V8Proxy::ReferenceError); >+ return V8Proxy::throwError(V8Proxy::ReferenceError, "XMLHttpRequest constructor's associated context is not available"); > > RefPtr<SecurityOrigin> securityOrigin; > if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered())
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 86579
:
142161
| 142164