Changeset 117733 in webkit
- Timestamp:
- May 20, 2012 11:28:54 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117732 r117733 1 2012-05-20 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Pass Isolate to throwError()s in V8 custom bindings (Part 1) 4 https://bugs.webkit.org/show_bug.cgi?id=86980 5 6 Reviewed by Adam Barth. 7 8 The objective is to pass Isolate around in V8 bindings. 9 This patch passes Isolate to throwError()s in V8 custom bindings. 10 11 No tests. No change in behavior. 12 13 * bindings/v8/custom/V8ArrayBufferCustom.cpp: 14 (WebCore::V8ArrayBuffer::constructorCallback): 15 * bindings/v8/custom/V8ArrayBufferViewCustom.h: 16 (WebCore::constructWebGLArrayWithArrayBufferArgument): 17 (WebCore::constructWebGLArray): 18 * bindings/v8/custom/V8AudioContextCustom.cpp: 19 (WebCore::V8AudioContext::constructorCallback): 20 * bindings/v8/custom/V8BlobCustom.cpp: 21 (WebCore::V8Blob::constructorCallback): 22 * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp: 23 (WebCore::V8CSSStyleDeclaration::namedPropertySetter): 24 * bindings/v8/custom/V8ClipboardCustom.cpp: 25 (WebCore::V8Clipboard::clearDataCallback): 26 (WebCore::V8Clipboard::setDragImageCallback): 27 * bindings/v8/custom/V8DOMFormDataCustom.cpp: 28 (WebCore::V8DOMFormData::appendCallback): 29 * bindings/v8/custom/V8DOMStringMapCustom.cpp: 30 (WebCore::V8DOMStringMap::namedPropertySetter): 31 * bindings/v8/custom/V8DOMWindowCustom.cpp: 32 (WebCore::handlePostMessageCallback): 33 * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp: 34 (WebCore::handlePostMessageCallback): 35 * bindings/v8/custom/V8DirectoryEntryCustom.cpp: 36 (WebCore::V8DirectoryEntry::getDirectoryCallback): 37 (WebCore::V8DirectoryEntry::getFileCallback): 38 * bindings/v8/custom/V8DocumentCustom.cpp: 39 (WebCore::V8Document::evaluateCallback): 40 1 41 2012-05-20 Kentaro Hara <haraken@chromium.org> 2 42 -
trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp
r117579 r117733 71 71 buffer = ArrayBuffer::create(static_cast<unsigned>(length), 1); 72 72 if (!buffer.get()) 73 return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer size is not a small enough positive integer." );73 return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer size is not a small enough positive integer.", args.GetIsolate()); 74 74 // Transform the holder into a wrapper object for the array. 75 75 V8DOMWrapper::setDOMWrapper(args.Holder(), &info, buffer.get()); -
trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
r117579 r117733 77 77 } else { 78 78 if ((buf->byteLength() - offset) % sizeof(ElementType)) 79 return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size." );79 return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size.", args.GetIsolate()); 80 80 length = (buf->byteLength() - offset) / sizeof(ElementType); 81 81 } … … 170 170 array = ArrayClass::create(len); 171 171 if (!array.get()) 172 return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBufferView size is not a small enough positive integer." );172 return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBufferView size is not a small enough positive integer.", args.GetIsolate()); 173 173 174 174 -
trunk/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp
r117448 r117733 52 52 Frame* frame = V8Proxy::retrieveFrameForCurrentContext(); 53 53 if (!frame) 54 return V8Proxy::throwError(V8Proxy::ReferenceError, "AudioContext constructor associated frame is unavailable" );54 return V8Proxy::throwError(V8Proxy::ReferenceError, "AudioContext constructor associated frame is unavailable", args.GetIsolate()); 55 55 56 56 Document* document = frame->document(); 57 57 if (!document) 58 return V8Proxy::throwError(V8Proxy::ReferenceError, "AudioContext constructor associated document is unavailable" );58 return V8Proxy::throwError(V8Proxy::ReferenceError, "AudioContext constructor associated document is unavailable", args.GetIsolate()); 59 59 60 60 RefPtr<AudioContext> audioContext; … … 65 65 audioContext = AudioContext::create(document, ec); 66 66 if (ec) 67 return throwError(ec );67 return throwError(ec, args.GetIsolate()); 68 68 if (!audioContext.get()) 69 return V8Proxy::throwError(V8Proxy::SyntaxError, "audio resources unavailable for AudioContext construction" );69 return V8Proxy::throwError(V8Proxy::SyntaxError, "audio resources unavailable for AudioContext construction", args.GetIsolate()); 70 70 } else { 71 71 // Constructor for offline (render-target) AudioContext which renders into an AudioBuffer. … … 78 78 int32_t numberOfChannels = toInt32(args[0], ok); 79 79 if (!ok || numberOfChannels <= 0 || numberOfChannels > 10) 80 return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid number of channels" );80 return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid number of channels", args.GetIsolate()); 81 81 82 82 int32_t numberOfFrames = toInt32(args[1], ok); 83 83 if (!ok || numberOfFrames <= 0) 84 return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid number of frames" );84 return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid number of frames", args.GetIsolate()); 85 85 86 86 float sampleRate = toFloat(args[2]); 87 87 if (sampleRate <= 0) 88 return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid sample rate" );88 return V8Proxy::throwError(V8Proxy::SyntaxError, "Invalid sample rate", args.GetIsolate()); 89 89 90 90 ExceptionCode ec = 0; 91 91 audioContext = AudioContext::createOfflineContext(document, numberOfChannels, numberOfFrames, sampleRate, ec); 92 92 if (ec) 93 return throwError(ec );93 return throwError(ec, args.GetIsolate()); 94 94 } 95 95 96 96 if (!audioContext.get()) 97 return V8Proxy::throwError(V8Proxy::SyntaxError, "Error creating AudioContext" );97 return V8Proxy::throwError(V8Proxy::SyntaxError, "Error creating AudioContext", args.GetIsolate()); 98 98 99 99 // Transform the holder into a wrapper object for the audio context. -
trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp
r117448 r117733 69 69 ScriptExecutionContext* context = getScriptExecutionContext(); 70 70 if (!context) 71 return V8Proxy::throwError(V8Proxy::ReferenceError, "Blob constructor associated document is unavailable" );71 return V8Proxy::throwError(V8Proxy::ReferenceError, "Blob constructor associated document is unavailable", args.GetIsolate()); 72 72 73 73 if (!args.Length()) { … … 92 92 bool containsEndings = dictionary.get("endings", endings); 93 93 if (tryCatchEndings.HasCaught()) 94 return throwError(tryCatchEndings.Exception() );94 return throwError(tryCatchEndings.Exception(), args.GetIsolate()); 95 95 96 96 if (containsEndings) { … … 102 102 dictionary.get("type", type); 103 103 if (tryCatchType.HasCaught()) 104 return throwError(tryCatchType.Exception() );104 return throwError(tryCatchType.Exception(), args.GetIsolate()); 105 105 } 106 106 -
trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
r113795 r117733 239 239 240 240 if (ec) 241 throwError(ec );241 throwError(ec, info.GetIsolate()); 242 242 243 243 return value; -
trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
r117536 r117733 74 74 75 75 if (args.Length() != 1) 76 return V8Proxy::throwError(V8Proxy::SyntaxError, "clearData: Invalid number of arguments" );76 return V8Proxy::throwError(V8Proxy::SyntaxError, "clearData: Invalid number of arguments", args.GetIsolate()); 77 77 78 78 String type = toWebCoreString(args[0]); … … 90 90 91 91 if (args.Length() != 3) 92 return V8Proxy::throwError(V8Proxy::SyntaxError, "setDragImage: Invalid number of arguments" );92 return V8Proxy::throwError(V8Proxy::SyntaxError, "setDragImage: Invalid number of arguments", args.GetIsolate()); 93 93 94 94 int x = toInt32(args[1]); -
trunk/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
r117448 r117733 66 66 67 67 if (args.Length() < 2) 68 return V8Proxy::throwError(V8Proxy::SyntaxError, "Not enough arguments" );68 return V8Proxy::throwError(V8Proxy::SyntaxError, "Not enough arguments", args.GetIsolate()); 69 69 70 70 DOMFormData* domFormData = V8DOMFormData::toNative(args.Holder()); -
trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
r115366 r117733 81 81 V8DOMStringMap::toNative(info.Holder())->setItem(toWebCoreString(name), toWebCoreString(value), ec); 82 82 if (ec) 83 return throwError(ec );83 return throwError(ec, info.GetIsolate()); 84 84 return value; 85 85 } -
trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
r115233 r117733 344 344 ExceptionCode ec = 0; 345 345 window->postMessage(message.release(), &portArray, targetOrigin, source, ec); 346 return throwError(ec );346 return throwError(ec, args.GetIsolate()); 347 347 } 348 348 -
trunk/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
r115233 r117733 64 64 ExceptionCode ec = 0; 65 65 workerContext->postMessage(message.release(), &ports, ec); 66 return throwError(ec );66 return throwError(ec, args.GetIsolate()); 67 67 } 68 68 -
trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
r115522 r117733 77 77 if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) { 78 78 if (!args[2]->IsObject()) 79 return throwError(TYPE_MISMATCH_ERR );79 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 80 80 successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext()); 81 81 } … … 83 83 if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) { 84 84 if (!args[3]->IsObject()) 85 return throwError(TYPE_MISMATCH_ERR );85 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 86 86 errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext()); 87 87 } … … 121 121 if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) { 122 122 if (!args[2]->IsObject()) 123 return throwError(TYPE_MISMATCH_ERR );123 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 124 124 successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext()); 125 125 } … … 127 127 if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) { 128 128 if (!args[3]->IsObject()) 129 return throwError(TYPE_MISMATCH_ERR );129 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 130 130 errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext()); 131 131 } -
trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
r114925 r117733 77 77 RefPtr<XPathNSResolver> resolver = V8DOMWrapper::getXPathNSResolver(args[2]); 78 78 if (!resolver && !args[2]->IsNull() && !args[2]->IsUndefined()) 79 return throwError(TYPE_MISMATCH_ERR );79 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 80 80 81 81 int type = toInt32(args[3]); … … 87 87 RefPtr<XPathResult> result = document->evaluate(expression, contextNode.get(), resolver.get(), type, inResult.get(), ec); 88 88 if (exceptionCatcher.HasCaught()) 89 return throwError(exceptionCatcher.Exception() );89 return throwError(exceptionCatcher.Exception(), args.GetIsolate()); 90 90 91 91 if (ec) 92 return throwError(ec );92 return throwError(ec, args.GetIsolate()); 93 93 94 94 return toV8(result.release(), args.GetIsolate());
Note: See TracChangeset
for help on using the changeset viewer.