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

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

Issue 11147026: Initial refactor to get profiles to propagate storage partition details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changing bool param to pass by reference. Created 8 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
Index: chrome/browser/extensions/data_deleter.cc
diff --git a/chrome/browser/extensions/data_deleter.cc b/chrome/browser/extensions/data_deleter.cc
index 07cc87a2a7cbe371f8a81a6c9002945c33e73cbe..9f4ca9a4996cf7850afec6485e966e2fd5c97c78 100644
--- a/chrome/browser/extensions/data_deleter.cc
+++ b/chrome/browser/extensions/data_deleter.cc
@@ -14,6 +14,8 @@
#include "chrome/common/url_constants.h"
#include "content/public/browser/dom_storage_context.h"
#include "content/public/browser/indexed_db_context.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/site_instance.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_constants.h"
#include "net/base/completion_callback.h"
@@ -92,11 +94,19 @@ DataDeleter::DataDeleter(
if (storage_origin.SchemeIs(chrome::kExtensionScheme)) {
extension_request_context_ = profile->GetRequestContextForExtensions();
} else if (is_storage_isolated) {
- extension_request_context_ =
- profile->GetRequestContextForStoragePartition(extension_id);
- isolated_app_path_ =
- profile->GetPath().Append(
- content::StoragePartition::GetPartitionPath(extension_id));
+ GURL url = Extension::GetBaseURLFromExtensionId(extension_id);
+ ExtensionProcessManager* process_manager =
+ profile->GetExtensionProcessManager();
+ if (process_manager) {
+ content::SiteInstance* site = process_manager->GetSiteInstanceForURL(url);
+ content::StoragePartition* storage_partition =
+ site->GetProcess()->GetStoragePartition();
+ extension_request_context_ =
+ profile->GetRequestContextForStoragePartition(
awong 2012/10/18 22:36:15 Why isn't this just the RequestContext() out of st
nasko 2012/10/19 17:29:14 Done.
+ storage_partition->GetPath(),
+ storage_partition->IsInMemoryOnly());
+ isolated_app_path_ = storage_partition->GetPath();
+ }
} else {
extension_request_context_ = profile->GetRequestContext();
}

Powered by Google App Engine
This is Rietveld 408576698