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

Unified Diff: content/browser/chrome_blob_storage_context.cc

Issue 9425026: Remove getters for HTML5 related objects from the ResourceContext interface. Half of them weren't u… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix race condition Created 8 years, 10 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: content/browser/chrome_blob_storage_context.cc
===================================================================
--- content/browser/chrome_blob_storage_context.cc (revision 122771)
+++ content/browser/chrome_blob_storage_context.cc (working copy)
@@ -4,11 +4,33 @@
#include "content/browser/chrome_blob_storage_context.h"
+#include "base/bind.h"
+#include "content/public/browser/browser_context.h"
#include "webkit/blob/blob_storage_controller.h"
+using base::UserDataAdapter;
+using content::BrowserContext;
using content::BrowserThread;
using webkit_blob::BlobStorageController;
+static const char* kBlobStorageContextKeyName = "content_blob_storage_context";
+
+ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
+ BrowserContext* context) {
+ if (!context->GetUserData(kBlobStorageContextKeyName)) {
+ scoped_refptr<ChromeBlobStorageContext> blob =
+ new ChromeBlobStorageContext();
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&ChromeBlobStorageContext::InitializeOnIOThread, blob));
+ context->SetUserData(kBlobStorageContextKeyName,
+ new UserDataAdapter<ChromeBlobStorageContext>(blob));
+ }
+
+ return UserDataAdapter<ChromeBlobStorageContext>::Get(
+ context, kBlobStorageContextKeyName);
+}
+
ChromeBlobStorageContext::ChromeBlobStorageContext() {
}

Powered by Google App Engine
This is Rietveld 408576698