Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Unified Diff: Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp

Issue 114363002: Structured cloning: improve DataCloneError reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + reset V8TestInterfaceConstructor.cpp result Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/V8Utilities.cpp ('k') | Source/bindings/v8/custom/V8HistoryCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp
diff --git a/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp b/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp
index a356f03e4fef9ecea6c2e8f382852e21581cc1dc..480ae11821b95c9ff0f8cd92a48894f1a0c0149d 100644
--- a/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp
+++ b/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp
@@ -44,23 +44,21 @@ namespace WebCore {
void V8DedicatedWorkerGlobalScope::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", "WorkerGlobalScope", info.Holder(), info.GetIsolate());
DedicatedWorkerGlobalScope* workerGlobalScope = V8DedicatedWorkerGlobalScope::toNative(info.Holder());
MessagePortArray ports;
ArrayBufferArray arrayBuffers;
if (info.Length() > 1) {
const int transferablesArgIndex = 1;
- bool notASequence = false;
- if (!extractTransferables(info[transferablesArgIndex], ports, arrayBuffers, notASequence, info.GetIsolate())) {
- if (notASequence)
- throwTypeError(ExceptionMessages::failedToExecute("postMessage", "WorkerGlobalScope", ExceptionMessages::notAnArrayTypeArgumentOrValue(transferablesArgIndex + 1)), info.GetIsolate());
+ if (!extractTransferables(info[transferablesArgIndex], transferablesArgIndex, ports, arrayBuffers, exceptionState, info.GetIsolate())) {
+ exceptionState.throwIfNeeded();
return;
}
}
- bool didThrow = false;
- RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(info[0], &ports, &arrayBuffers, didThrow, info.GetIsolate());
- if (didThrow)
+ RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(info[0], &ports, &arrayBuffers, exceptionState, info.GetIsolate());
+ if (exceptionState.throwIfNeeded())
return;
- ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+
workerGlobalScope->postMessage(message.release(), &ports, exceptionState);
exceptionState.throwIfNeeded();
}
« no previous file with comments | « Source/bindings/v8/V8Utilities.cpp ('k') | Source/bindings/v8/custom/V8HistoryCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698