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

Unified Diff: webkit/tools/test_shell/test_shell_webblobregistry_impl.cc

Issue 3582002: Add deletable file refs to Blobs (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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 | « webkit/blob/blob_storage_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_shell_webblobregistry_impl.cc
===================================================================
--- webkit/tools/test_shell/test_shell_webblobregistry_impl.cc (revision 61866)
+++ webkit/tools/test_shell/test_shell_webblobregistry_impl.cc (working copy)
@@ -17,9 +17,13 @@
using WebKit::WebString;
using WebKit::WebURL;
+namespace {
+
MessageLoop* g_io_thread;
webkit_blob::BlobStorageController* g_blob_storage_controller;
+} // namespace
+
/* static */
void TestShellWebBlobRegistryImpl::InitializeOnIOThread(
webkit_blob::BlobStorageController* blob_storage_controller) {
@@ -39,15 +43,14 @@
void TestShellWebBlobRegistryImpl::registerBlobURL(
const WebURL& url, WebBlobData& data) {
DCHECK(g_io_thread);
+ // Note: BlobData is not refcounted thread safe.
scoped_refptr<webkit_blob::BlobData> blob_data(
new webkit_blob::BlobData(data));
- blob_data->AddRef(); // Release on DoRegisterBlobURL.
g_io_thread->PostTask(
FROM_HERE,
- NewRunnableMethod(this,
- &TestShellWebBlobRegistryImpl::DoRegisterBlobUrl,
- url,
- blob_data.get()));
+ NewRunnableMethod(
+ this, &TestShellWebBlobRegistryImpl::DoRegisterBlobUrl, url,
+ blob_data.release())); // Released in DoRegisterBlobUrl.
}
void TestShellWebBlobRegistryImpl::registerBlobURL(
« no previous file with comments | « webkit/blob/blob_storage_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698