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

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

Issue 2193173002: Move ThreadableLoader to Oilpan heap (1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onheap-bridge-peer-in-worker-threadable-loader
Patch Set: rebase 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/FileReaderSync.cpp
diff --git a/third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp b/third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp
index 09aaa19cdb19a6c438a3286ef119d89e9c33cba0..efee518953703589917f6b8480182c82f5a6f31c 100644
--- a/third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp
+++ b/third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp
@@ -46,39 +46,39 @@ DOMArrayBuffer* FileReaderSync::readAsArrayBuffer(ExecutionContext* executionCon
{
ASSERT(blob);
- FileReaderLoader loader(FileReaderLoader::ReadAsArrayBuffer, nullptr);
- startLoading(executionContext, loader, *blob, exceptionState);
+ std::unique_ptr<FileReaderLoader> loader = FileReaderLoader::create(FileReaderLoader::ReadAsArrayBuffer, nullptr);
+ startLoading(executionContext, *loader, *blob, exceptionState);
- return loader.arrayBufferResult();
+ return loader->arrayBufferResult();
}
String FileReaderSync::readAsBinaryString(ExecutionContext* executionContext, Blob* blob, ExceptionState& exceptionState)
{
ASSERT(blob);
- FileReaderLoader loader(FileReaderLoader::ReadAsBinaryString, 0);
- startLoading(executionContext, loader, *blob, exceptionState);
- return loader.stringResult();
+ std::unique_ptr<FileReaderLoader> loader = FileReaderLoader::create(FileReaderLoader::ReadAsBinaryString, nullptr);
+ startLoading(executionContext, *loader, *blob, exceptionState);
+ return loader->stringResult();
}
String FileReaderSync::readAsText(ExecutionContext* executionContext, Blob* blob, const String& encoding, ExceptionState& exceptionState)
{
ASSERT(blob);
- FileReaderLoader loader(FileReaderLoader::ReadAsText, nullptr);
- loader.setEncoding(encoding);
- startLoading(executionContext, loader, *blob, exceptionState);
- return loader.stringResult();
+ std::unique_ptr<FileReaderLoader> loader = FileReaderLoader::create(FileReaderLoader::ReadAsText, nullptr);
+ loader->setEncoding(encoding);
+ startLoading(executionContext, *loader, *blob, exceptionState);
+ return loader->stringResult();
}
String FileReaderSync::readAsDataURL(ExecutionContext* executionContext, Blob* blob, ExceptionState& exceptionState)
{
ASSERT(blob);
- FileReaderLoader loader(FileReaderLoader::ReadAsDataURL, nullptr);
- loader.setDataType(blob->type());
- startLoading(executionContext, loader, *blob, exceptionState);
- return loader.stringResult();
+ std::unique_ptr<FileReaderLoader> loader = FileReaderLoader::create(FileReaderLoader::ReadAsDataURL, nullptr);
+ loader->setDataType(blob->type());
+ startLoading(executionContext, *loader, *blob, exceptionState);
+ return loader->stringResult();
}
void FileReaderSync::startLoading(ExecutionContext* executionContext, FileReaderLoader& loader, const Blob& blob, ExceptionState& exceptionState)

Powered by Google App Engine
This is Rietveld 408576698