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

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

Issue 204983007: Make ThreadableLoader class to use references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 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 | « Source/core/fileapi/FileReaderLoader.h ('k') | Source/core/inspector/InspectorResourceAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fileapi/FileReaderLoader.cpp
diff --git a/Source/core/fileapi/FileReaderLoader.cpp b/Source/core/fileapi/FileReaderLoader.cpp
index 74e518bcb39cfff9711272e55bbfcaecf3aa1a4d..fc3d3f61979d9991d25f886427e5f05926182ac9 100644
--- a/Source/core/fileapi/FileReaderLoader.cpp
+++ b/Source/core/fileapi/FileReaderLoader.cpp
@@ -81,10 +81,10 @@ FileReaderLoader::~FileReaderLoader()
}
}
-void FileReaderLoader::startInternal(ExecutionContext* executionContext, const Stream* stream, PassRefPtr<BlobDataHandle> blobData)
+void FileReaderLoader::startInternal(ExecutionContext& executionContext, const Stream* stream, PassRefPtr<BlobDataHandle> blobData)
{
// The blob is read by routing through the request handling layer given a temporary public url.
- m_urlForReading = BlobURL::createPublicURL(executionContext->securityOrigin());
+ m_urlForReading = BlobURL::createPublicURL(executionContext.securityOrigin());
if (m_urlForReading.isEmpty()) {
failed(FileError::SECURITY_ERR);
return;
@@ -92,10 +92,10 @@ void FileReaderLoader::startInternal(ExecutionContext* executionContext, const S
if (blobData) {
ASSERT(!stream);
- BlobRegistry::registerPublicBlobURL(executionContext->securityOrigin(), m_urlForReading, blobData);
+ BlobRegistry::registerPublicBlobURL(executionContext.securityOrigin(), m_urlForReading, blobData);
} else {
ASSERT(stream);
- BlobRegistry::registerStreamURL(executionContext->securityOrigin(), m_urlForReading, stream->url());
+ BlobRegistry::registerStreamURL(executionContext.securityOrigin(), m_urlForReading, stream->url());
}
// Construct and load the request.
@@ -122,12 +122,14 @@ void FileReaderLoader::startInternal(ExecutionContext* executionContext, const S
void FileReaderLoader::start(ExecutionContext* executionContext, PassRefPtr<BlobDataHandle> blobData)
{
+ ASSERT(executionContext);
m_urlForReadingIsStream = false;
- startInternal(executionContext, 0, blobData);
+ startInternal(*executionContext, 0, blobData);
}
void FileReaderLoader::start(ExecutionContext* executionContext, const Stream& stream, unsigned readSize)
{
+ ASSERT(executionContext);
if (readSize > 0) {
m_hasRange = true;
m_rangeStart = 0;
@@ -135,7 +137,7 @@ void FileReaderLoader::start(ExecutionContext* executionContext, const Stream& s
}
m_urlForReadingIsStream = true;
- startInternal(executionContext, &stream, nullptr);
+ startInternal(*executionContext, &stream, nullptr);
}
void FileReaderLoader::cancel()
« no previous file with comments | « Source/core/fileapi/FileReaderLoader.h ('k') | Source/core/inspector/InspectorResourceAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698