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

Unified Diff: chrome/browser/extensions/data_deleter.cc

Issue 10836216: Add SiteInstance parameters to IndexedDBContext calls (Closed) Base URL: http://git.chromium.org/chromium/src.git@isolated-storage
Patch Set: Candidate patch Created 8 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: chrome/browser/extensions/data_deleter.cc
diff --git a/chrome/browser/extensions/data_deleter.cc b/chrome/browser/extensions/data_deleter.cc
index 409b8dfa2949a3928ce7d735a3973939ea85fa90..d5c9c7a580edb60d8af11e72ad048549fd12dadc 100644
--- a/chrome/browser/extensions/data_deleter.cc
+++ b/chrome/browser/extensions/data_deleter.cc
@@ -54,8 +54,7 @@ void DataDeleter::StartDeleting(Profile* profile,
BrowserThread::WEBKIT_DEPRECATED, FROM_HERE,
base::Bind(
&DataDeleter::DeleteIndexedDBOnWebkitThread,
- deleter,
- make_scoped_refptr(BrowserContext::GetIndexedDBContext(profile))));
+ deleter));
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
@@ -88,17 +87,30 @@ DataDeleter::DataDeleter(
GetDatabaseTracker();
// Pick the right request context depending on whether it's an extension,
// isolated app, or regular app.
awong 2012/09/10 21:55:21 I think for right now, just use GetDefaultStorageP
alecflett 2012/09/10 23:14:55 Heh, that seems very sad. But ok...it vastly simpl
awong 2012/09/10 23:17:53 Yeah it's sad...there's an outstanding bug to fix
+ content::StoragePartition* storage_partition;
awong 2012/09/10 21:55:21 Initialize to NULL?
alecflett 2012/09/10 23:14:55 I specifically didn't so clang would complain if I
if (storage_origin.SchemeIs(chrome::kExtensionScheme)) {
extension_request_context_ = profile->GetRequestContextForExtensions();
+ storage_partition = BrowserContext::GetDefaultStoragePartition(profile);
} else if (is_storage_isolated) {
+ GURL extension_url =
+ extensions::Extension::GetBaseURLFromExtensionId(extension_id);
+ ExtensionProcessManager* manager = profile->GetExtensionProcessManager();
+ content::SiteInstance* site_instance =
+ manager->GetSiteInstanceForURL(extension_url);
+ storage_partition =
+ BrowserContext::GetStoragePartition(profile, site_instance);
extension_request_context_ =
profile->GetRequestContextForIsolatedApp(extension_id);
isolated_app_path_ = profile->GetPath().
Append(content::kStoragePartitionDirname).AppendASCII(extension_id);
} else {
extension_request_context_ = profile->GetRequestContext();
+ storage_partition = BrowserContext::GetDefaultStoragePartition(profile);
}
+
file_system_context_ = BrowserContext::GetFileSystemContext(profile);
+ indexed_db_context_ = storage_partition->GetIndexedDBContext();
+
storage_origin_ = storage_origin;
origin_id_ =
webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_);
@@ -124,10 +136,9 @@ void DataDeleter::DeleteDatabaseOnFileThread() {
DCHECK(rv == net::OK || rv == net::ERR_IO_PENDING);
}
-void DataDeleter::DeleteIndexedDBOnWebkitThread(
- scoped_refptr<IndexedDBContext> indexed_db_context) {
+void DataDeleter::DeleteIndexedDBOnWebkitThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
- indexed_db_context->DeleteForOrigin(storage_origin_);
+ indexed_db_context_->DeleteForOrigin(storage_origin_);
}
void DataDeleter::DeleteFileSystemOnFileThread() {

Powered by Google App Engine
This is Rietveld 408576698