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

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

Issue 2147633002: Remove nonstandard 'endings' option for Blob/File constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Layout test updates Created 4 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: third_party/WebKit/Source/core/fileapi/Blob.cpp
diff --git a/third_party/WebKit/Source/core/fileapi/Blob.cpp b/third_party/WebKit/Source/core/fileapi/Blob.cpp
index 57c3b5f1a01d0cf0d25f46d1bdc00625c4f122fa..eeef1023267051c21200b93d98336f6657d1f5f2 100644
--- a/third_party/WebKit/Source/core/fileapi/Blob.cpp
+++ b/third_party/WebKit/Source/core/fileapi/Blob.cpp
@@ -95,15 +95,10 @@ Blob* Blob::create(ExecutionContext* context, const HeapVector<ArrayBufferOrArra
return nullptr;
}
- ASSERT(options.hasEndings());
- bool normalizeLineEndingsToNative = options.endings() == "native";
- if (normalizeLineEndingsToNative)
- UseCounter::count(context, UseCounter::FileAPINativeLineEndings);
-
std::unique_ptr<BlobData> blobData = BlobData::create();
blobData->setContentType(options.type().lower());
- populateBlobData(blobData.get(), blobParts, normalizeLineEndingsToNative);
+ populateBlobData(blobData.get(), blobParts);
long long blobSize = blobData->length();
return new Blob(BlobDataHandle::create(std::move(blobData), blobSize));
@@ -122,7 +117,7 @@ Blob* Blob::create(const unsigned char* data, size_t bytes, const String& conten
}
// static
-void Blob::populateBlobData(BlobData* blobData, const HeapVector<ArrayBufferOrArrayBufferViewOrBlobOrUSVString>& parts, bool normalizeLineEndingsToNative)
+void Blob::populateBlobData(BlobData* blobData, const HeapVector<ArrayBufferOrArrayBufferViewOrBlobOrUSVString>& parts)
{
for (const auto& item : parts) {
if (item.isArrayBuffer()) {
@@ -134,7 +129,7 @@ void Blob::populateBlobData(BlobData* blobData, const HeapVector<ArrayBufferOrAr
} else if (item.isBlob()) {
item.getAsBlob()->appendTo(*blobData);
} else if (item.isUSVString()) {
- blobData->appendText(item.getAsUSVString(), normalizeLineEndingsToNative);
+ blobData->appendText(item.getAsUSVString());
} else {
NOTREACHED();
}

Powered by Google App Engine
This is Rietveld 408576698