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

Unified Diff: Source/core/fileapi/Blob.cpp

Issue 1235213004: Blob/File constructors/slice method shouldn't throw on invalid types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove debugging spew Created 5 years, 5 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/core/fileapi/Blob.cpp
diff --git a/Source/core/fileapi/Blob.cpp b/Source/core/fileapi/Blob.cpp
index 347381021299c7f58ba8354dd7d199020f3a4679..69864dcfd761c110ed57157f3c62a93a52d15aa2 100644
--- a/Source/core/fileapi/Blob.cpp
+++ b/Source/core/fileapi/Blob.cpp
@@ -89,10 +89,6 @@ Blob::~Blob()
Blob* Blob::create(const HeapVector<ArrayBufferOrArrayBufferViewOrBlobOrString>& blobParts, const BlobPropertyBag& options, ExceptionState& exceptionState)
{
ASSERT(options.hasType());
- if (!options.type().containsOnlyASCII()) {
- exceptionState.throwDOMException(SyntaxError, "The 'type' property must consist of ASCII characters.");
- return nullptr;
- }
ASSERT(options.hasEndings());
bool normalizeLineEndingsToNative = options.endings() == "native";
@@ -142,7 +138,7 @@ Blob* Blob::slice(long long start, long long end, const String& contentType, Exc
long long length = end - start;
OwnPtr<BlobData> blobData = BlobData::create();
- blobData->setContentType(contentType);
+ blobData->setContentType(contentType.lower());
blobData->appendBlob(m_blobDataHandle, start, length);
return Blob::create(BlobDataHandle::create(blobData.release(), length));
}

Powered by Google App Engine
This is Rietveld 408576698