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

Unified Diff: Source/platform/blob/BlobRegistry.cpp

Issue 747323007: Introduce Stream::flush [1/2 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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/platform/blob/BlobRegistry.h ('k') | public/platform/WebBlobRegistry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/blob/BlobRegistry.cpp
diff --git a/Source/platform/blob/BlobRegistry.cpp b/Source/platform/blob/BlobRegistry.cpp
index fb8f5c0aeecc7af6b544511d2658c0d2438ef59b..41cc90fbed94cae65d3ed9bb69753c7830717f69 100644
--- a/Source/platform/blob/BlobRegistry.cpp
+++ b/Source/platform/blob/BlobRegistry.cpp
@@ -212,6 +212,24 @@ void BlobRegistry::addDataToStream(const KURL& url, PassRefPtr<RawData> streamDa
}
}
+static void flushStreamTask(void* context)
+{
+ OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context));
+ if (WebBlobRegistry* registry = blobRegistry())
+ registry->flushStream(blobRegistryContext->url);
+}
+
+void BlobRegistry::flushStream(const KURL& url)
+{
+ if (isMainThread()) {
+ if (WebBlobRegistry* registry = blobRegistry())
+ registry->flushStream(url);
+ } else {
+ OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url));
+ callOnMainThread(&flushStreamTask, context.leakPtr());
+ }
+}
+
static void finalizeStreamTask(void* context)
{
OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context));
« no previous file with comments | « Source/platform/blob/BlobRegistry.h ('k') | public/platform/WebBlobRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698