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

Unified Diff: extensions/browser/extension_util.cc

Issue 2166523003: Add ref count to service workers for extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync@tott Created 4 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
« no previous file with comments | « extensions/browser/extension_util.h ('k') | extensions/common/api/_api_features.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_util.cc
diff --git a/extensions/browser/extension_util.cc b/extensions/browser/extension_util.cc
index 4981790a9ed3b67f681cc229de8d2a4e26244684..142e1e482dd1e1725bf834e63cf5924018cbc51e 100644
--- a/extensions/browser/extension_util.cc
+++ b/extensions/browser/extension_util.cc
@@ -4,6 +4,8 @@
#include "extensions/browser/extension_util.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/browser/site_instance.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/manifest_handlers/app_isolation_info.h"
@@ -43,5 +45,16 @@ bool CanBeIncognitoEnabled(const Extension* extension) {
extension->location() == Manifest::COMPONENT);
}
+content::StoragePartition* GetStoragePartitionForExtensionId(
+ const std::string& extension_id,
+ content::BrowserContext* browser_context) {
+ GURL site_url = content::SiteInstance::GetSiteForURL(
+ browser_context, Extension::GetBaseURLFromExtensionId(extension_id));
+ content::StoragePartition* storage_partition =
+ content::BrowserContext::GetStoragePartitionForSite(browser_context,
+ site_url);
+ return storage_partition;
+}
+
} // namespace util
} // namespace extensions
« no previous file with comments | « extensions/browser/extension_util.h ('k') | extensions/common/api/_api_features.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698