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

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

Issue 57483002: Implement File constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed nits. Created 7 years, 1 month 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/v8/custom/V8BlobCustom.cpp
diff --git a/Source/bindings/v8/custom/V8BlobCustom.cpp b/Source/bindings/v8/custom/V8BlobCustom.cpp
index d514a4eff6a71eb5d36f0cdd090baecd2215bb7e..41ff90d7d7fd1a43dae9238de2665f6cdf50b61c 100644
--- a/Source/bindings/v8/custom/V8BlobCustom.cpp
+++ b/Source/bindings/v8/custom/V8BlobCustom.cpp
@@ -49,8 +49,8 @@ void V8Blob::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
return;
}
- v8::Local<v8::Value> firstArg = info[0];
- if (!firstArg->IsArray()) {
+ // FIXME: handle WebIDL sequences, see http://crbug.com/314755
+ if (!info[0]->IsArray()) {
throwTypeError("First argument of the constructor is not of type Array", info.GetIsolate());
return;
}
@@ -87,7 +87,7 @@ void V8Blob::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
BlobBuilder blobBuilder;
- V8TRYCATCH_VOID(v8::Local<v8::Array>, blobParts, v8::Local<v8::Array>::Cast(firstArg));
+ V8TRYCATCH_VOID(v8::Local<v8::Array>, blobParts, v8::Local<v8::Array>::Cast(info[0]));
uint32_t length = blobParts->Length();
for (uint32_t i = 0; i < length; ++i) {
@@ -111,7 +111,7 @@ void V8Blob::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
}
}
- RefPtr<Blob> blob = blobBuilder.getBlob(type);
+ RefPtr<Blob> blob = blobBuilder.createBlob(type);
info.GetReturnValue().Set(toV8(blob.get(), info.Holder(), info.GetIsolate()));
}

Powered by Google App Engine
This is Rietveld 408576698