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

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

Issue 111373003: Migrate bindings constructors to the new ExceptionState model. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ugh. 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/Dictionary.cpp ('k') | Source/bindings/v8/custom/V8BlobCustomHelpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8BlobCustom.cpp
diff --git a/Source/bindings/v8/custom/V8BlobCustom.cpp b/Source/bindings/v8/custom/V8BlobCustom.cpp
index e5c8faa748f4441ae74e3b2d35fa4db2fb9b1ea0..db9fbbb429585b3745bb39cb5588adc444c5b08f 100644
--- a/Source/bindings/v8/custom/V8BlobCustom.cpp
+++ b/Source/bindings/v8/custom/V8BlobCustom.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "V8Blob.h"
+#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/custom/V8BlobCustomHelpers.h"
#include "core/fileapi/BlobBuilder.h"
@@ -38,6 +39,7 @@ namespace WebCore {
void V8Blob::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ConstructionContext, "Blob", info.Holder(), info.GetIsolate());
if (!info.Length()) {
RefPtr<Blob> blob = Blob::create();
v8SetReturnValue(info, blob.release());
@@ -50,7 +52,8 @@ void V8Blob::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
} else {
const int sequenceArgumentIndex = 0;
if (toV8Sequence(info[sequenceArgumentIndex], length, info.GetIsolate()).IsEmpty()) {
- throwTypeError(ExceptionMessages::failedToConstruct("Blob", ExceptionMessages::notAnArrayTypeArgumentOrValue(sequenceArgumentIndex + 1)), info.GetIsolate());
+ exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(sequenceArgumentIndex + 1));
+ exceptionState.throwIfNeeded();
return;
}
}
@@ -58,12 +61,15 @@ void V8Blob::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
V8BlobCustomHelpers::ParsedProperties properties(false);
if (info.Length() > 1) {
if (!info[1]->IsObject()) {
- throwTypeError(ExceptionMessages::failedToConstruct("Blob", "The 2nd argument is not of type Object."), info.GetIsolate());
+ exceptionState.throwTypeError("The 2nd argument is not of type Object.");
+ exceptionState.throwIfNeeded();
return;
}
- if (!properties.parseBlobPropertyBag(info[1], "Blob", info.GetIsolate()))
+ if (!properties.parseBlobPropertyBag(info[1], "Blob", exceptionState, info.GetIsolate())) {
+ exceptionState.throwIfNeeded();
return;
+ }
}
BlobBuilder blobBuilder;
« no previous file with comments | « Source/bindings/v8/Dictionary.cpp ('k') | Source/bindings/v8/custom/V8BlobCustomHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698