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

Unified Diff: Source/bindings/core/v8/custom/V8MessageEventCustom.cpp

Issue 555133003: Use ExceptionState to throw exceptions when converting arrays (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 3 months 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
Index: Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
diff --git a/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp b/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
index 8bc5ad18bd0140646cdf2beac519801f9a6ab22f..fda22831b3f907d69013bc9f53233db7e5f7e38f 100644
--- a/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
@@ -104,6 +104,7 @@ void V8MessageEvent::dataAttributeGetterCustom(const v8::PropertyCallbackInfo<v8
void V8MessageEvent::initMessageEventMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "initMessageEvent", "MessageEvent", info.Holder(), info.GetIsolate());
MessageEvent* event = V8MessageEvent::toImpl(info.Holder());
TOSTRING_VOID(V8StringResource<>, typeArg, info[0]);
TONATIVE_VOID(bool, canBubbleArg, info[1]->BooleanValue());
@@ -116,9 +117,8 @@ void V8MessageEvent::initMessageEventMethodCustom(const v8::FunctionCallbackInfo
const int portArrayIndex = 7;
if (!isUndefinedOrNull(info[portArrayIndex])) {
portArray = adoptPtrWillBeNoop(new MessagePortArray);
- bool success = false;
- *portArray = toRefPtrWillBeMemberNativeArray<MessagePort, V8MessagePort>(info[portArrayIndex], portArrayIndex + 1, info.GetIsolate(), &success);
- if (!success)
+ *portArray = toRefPtrWillBeMemberNativeArray<MessagePort, V8MessagePort>(info[portArrayIndex], portArrayIndex + 1, info.GetIsolate(), exceptionState);
+ if (exceptionState.throwIfNeeded())
return;
}
event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, originArg, lastEventIdArg, sourceArg, portArray.release());
« no previous file with comments | « Source/bindings/core/v8/custom/V8ElementCustom.cpp ('k') | Source/bindings/core/v8/custom/V8WebGLRenderingContextCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698