Move GetSiteForExtensionId() from ExtensionService to extension_util
BUG=351891
[email protected] (c/b/sync_file_system)
[email protected] (c/b/chromeos/file_manager)
(No functional difference for either TBR)
Review URL: https://codereview.chromium.org/198053005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257297 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 992d2623..80cb9b7c4 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -69,7 +69,6 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.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/browser/url_data_source.h"
#include "extensions/browser/app_sorting.h"
@@ -493,12 +492,6 @@
return registry_->GetExtensionById(id, include_mask);
}
-GURL ExtensionService::GetSiteForExtensionId(const std::string& extension_id) {
- return content::SiteInstance::GetSiteForURL(
- profile_,
- Extension::GetBaseURLFromExtensionId(extension_id));
-}
-
void ExtensionService::Init() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -1232,7 +1225,8 @@
// Revoke external file access for the extension from its file system context.
// It is safe to access the extension's storage partition at this point. The
// storage partition may get destroyed only after the extension gets unloaded.
- GURL site = GetSiteForExtensionId(extension->id());
+ GURL site =
+ extensions::util::GetSiteForExtensionId(extension->id(), profile_);
fileapi::FileSystemContext* filesystem_context =
BrowserContext::GetStoragePartitionForSite(profile_, site)->
GetFileSystemContext();
@@ -2697,7 +2691,9 @@
it != extensions.end(); ++it) {
if (extensions::AppIsolationInfo::HasIsolatedStorage(it->get())) {
active_paths->insert(BrowserContext::GetStoragePartitionForSite(
- profile_, GetSiteForExtensionId((*it)->id()))->GetPath());
+ profile_,
+ extensions::util::GetSiteForExtensionId(
+ (*it)->id(), profile()))->GetPath());
}
}