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

Unified Diff: third_party/WebKit/Source/core/fileapi/File.cpp

Issue 1362963003: Blob/File constructors/slice method shouldn't throw on invalid types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated win expectation Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/core/fileapi/Blob.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fileapi/File.cpp
diff --git a/third_party/WebKit/Source/core/fileapi/File.cpp b/third_party/WebKit/Source/core/fileapi/File.cpp
index 03604b9b4ace6defc3383537906f0b4d455763dc..8576c47ef7c7e7d9c69b44e2214e76a9a40342f1 100644
--- a/third_party/WebKit/Source/core/fileapi/File.cpp
+++ b/third_party/WebKit/Source/core/fileapi/File.cpp
@@ -112,11 +112,6 @@ File* File::create(
const FilePropertyBag& options,
ExceptionState& exceptionState) {
ASSERT(options.hasType());
- if (!options.type().containsOnlyASCII()) {
- exceptionState.throwDOMException(
- SyntaxError, "The 'type' property must consist of ASCII characters.");
- return nullptr;
- }
double lastModified;
if (options.hasLastModified())
@@ -129,7 +124,7 @@ File* File::create(
UseCounter::count(context, UseCounter::FileAPINativeLineEndings);
std::unique_ptr<BlobData> blobData = BlobData::create();
- blobData->setContentType(options.type().lower());
+ blobData->setContentType(normalizeType(options.type()));
populateBlobData(blobData.get(), fileBits, normalizeLineEndingsToNative);
long long fileSize = blobData->length();
@@ -315,7 +310,7 @@ Blob* File::slice(long long start,
long long length = end - start;
std::unique_ptr<BlobData> blobData = BlobData::create();
- blobData->setContentType(contentType);
+ blobData->setContentType(normalizeType(contentType));
if (!m_fileSystemURL.isEmpty()) {
blobData->appendFileSystemURL(m_fileSystemURL, start, length,
modificationTimeMS / msPerSecond);
« no previous file with comments | « third_party/WebKit/Source/core/fileapi/Blob.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698