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

Side by Side 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: review comments 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/chrome_blob_storage_context.h" 5 #include "content/browser/chrome_blob_storage_context.h"
6 6
7 #include "base/bind.h"
8 #include "content/public/browser/browser_context.h"
7 #include "webkit/blob/blob_storage_controller.h" 9 #include "webkit/blob/blob_storage_controller.h"
8 10
11 using base::UserDataAdapter;
12 using content::BrowserContext;
9 using content::BrowserThread; 13 using content::BrowserThread;
10 using webkit_blob::BlobStorageController; 14 using webkit_blob::BlobStorageController;
11 15
16 static const char* kBlobStorageContextKeyName = "content_blob_storage_context";
17
18 ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
19 BrowserContext* context) {
20 if (!context->GetUserData(kBlobStorageContextKeyName)) {
21 scoped_refptr<ChromeBlobStorageContext> blob =
22 new ChromeBlobStorageContext();
23 BrowserThread::PostTask(
24 BrowserThread::IO, FROM_HERE,
25 base::Bind(&ChromeBlobStorageContext::InitializeOnIOThread, blob));
26 context->SetUserData(kBlobStorageContextKeyName,
27 new UserDataAdapter<ChromeBlobStorageContext>(blob));
28 }
29
30 return UserDataAdapter<ChromeBlobStorageContext>::Get(
31 context, kBlobStorageContextKeyName);
32 }
33
12 ChromeBlobStorageContext::ChromeBlobStorageContext() { 34 ChromeBlobStorageContext::ChromeBlobStorageContext() {
13 } 35 }
14 36
15 void ChromeBlobStorageContext::InitializeOnIOThread() { 37 void ChromeBlobStorageContext::InitializeOnIOThread() {
16 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
17 controller_.reset(new BlobStorageController()); 39 controller_.reset(new BlobStorageController());
18 } 40 }
19 41
20 ChromeBlobStorageContext::~ChromeBlobStorageContext() { 42 ChromeBlobStorageContext::~ChromeBlobStorageContext() {
21 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
22 } 44 }
OLDNEW
« no previous file with comments | « content/browser/chrome_blob_storage_context.h ('k') | content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698