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

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

Issue 23992003: blob hacking webcore style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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/FileReaderLoader.cpp
diff --git a/Source/core/fileapi/FileReaderLoader.cpp b/Source/core/fileapi/FileReaderLoader.cpp
index 7448e678d2920e65b154bdfde199132c9723c19b..082af17d8dbca14e6e1b1f877b2f6fd267a50885 100644
--- a/Source/core/fileapi/FileReaderLoader.cpp
+++ b/Source/core/fileapi/FileReaderLoader.cpp
@@ -78,11 +78,11 @@ FileReaderLoader::~FileReaderLoader()
if (m_urlForReadingIsStream)
BlobRegistry::unregisterStreamURL(m_urlForReading);
else
- BlobRegistry::unregisterBlobURL(m_urlForReading);
+ BlobRegistry::revokePublicBlobURL(m_urlForReading);
}
}
-void FileReaderLoader::startForURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url)
+void FileReaderLoader::startInternal(ScriptExecutionContext* scriptExecutionContext, const Stream* stream, PassRefPtr<BlobDataHandle> blobData)
kinuko 2013/09/30 11:31:53 No need to be done in this CL, but this method sho
{
// The blob is read by routing through the request handling layer given a temporary public url.
m_urlForReading = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
@@ -91,10 +91,10 @@ void FileReaderLoader::startForURL(ScriptExecutionContext* scriptExecutionContex
return;
}
- if (m_urlForReadingIsStream)
- BlobRegistry::registerStreamURL(scriptExecutionContext->securityOrigin(), m_urlForReading, url);
+ if (blobData)
+ BlobRegistry::registerPublicBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, blobData);
else
- BlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, url);
+ BlobRegistry::registerStreamURL(scriptExecutionContext->securityOrigin(), m_urlForReading, stream->url());
kinuko 2013/09/30 11:31:53 Can we assert somewhere that we must have either b
michaeln 2013/09/30 20:50:24 Will do (or done depending on when you look next).
// Construct and load the request.
ResourceRequest request(m_urlForReading);
@@ -117,10 +117,10 @@ void FileReaderLoader::startForURL(ScriptExecutionContext* scriptExecutionContex
ThreadableLoader::loadResourceSynchronously(scriptExecutionContext, request, *this, options);
}
-void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, const Blob& blob)
+void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<BlobDataHandle> blobData)
{
m_urlForReadingIsStream = false;
- startForURL(scriptExecutionContext, blob.url());
+ startInternal(scriptExecutionContext, 0, blobData);
}
void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, const Stream& stream, unsigned readSize)
@@ -132,7 +132,7 @@ void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, con
}
m_urlForReadingIsStream = true;
- startForURL(scriptExecutionContext, stream.url());
+ startInternal(scriptExecutionContext, &stream, 0);
}
void FileReaderLoader::cancel()

Powered by Google App Engine
This is Rietveld 408576698