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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_util.h" 5 #include "extensions/browser/extension_util.h"
6 6
7 #include "content/public/browser/browser_context.h"
8 #include "content/public/browser/site_instance.h"
7 #include "extensions/browser/extension_prefs.h" 9 #include "extensions/browser/extension_prefs.h"
8 #include "extensions/browser/extension_registry.h" 10 #include "extensions/browser/extension_registry.h"
9 #include "extensions/common/manifest_handlers/app_isolation_info.h" 11 #include "extensions/common/manifest_handlers/app_isolation_info.h"
10 #include "extensions/common/manifest_handlers/incognito_info.h" 12 #include "extensions/common/manifest_handlers/incognito_info.h"
11 13
12 namespace extensions { 14 namespace extensions {
13 namespace util { 15 namespace util {
14 16
15 bool HasIsolatedStorage(const ExtensionInfo& info) { 17 bool HasIsolatedStorage(const ExtensionInfo& info) {
16 if (!info.extension_manifest.get()) 18 if (!info.extension_manifest.get())
(...skipping 19 matching lines...) Expand all
36 38
37 return extension && AppIsolationInfo::HasIsolatedStorage(extension); 39 return extension && AppIsolationInfo::HasIsolatedStorage(extension);
38 } 40 }
39 41
40 bool CanBeIncognitoEnabled(const Extension* extension) { 42 bool CanBeIncognitoEnabled(const Extension* extension) {
41 return IncognitoInfo::IsIncognitoAllowed(extension) && 43 return IncognitoInfo::IsIncognitoAllowed(extension) &&
42 (!extension->is_platform_app() || 44 (!extension->is_platform_app() ||
43 extension->location() == Manifest::COMPONENT); 45 extension->location() == Manifest::COMPONENT);
44 } 46 }
45 47
48 content::StoragePartition* GetStoragePartitionForExtensionId(
49 const std::string& extension_id,
50 content::BrowserContext* browser_context) {
51 GURL site_url = content::SiteInstance::GetSiteForURL(
52 browser_context, Extension::GetBaseURLFromExtensionId(extension_id));
53 content::StoragePartition* storage_partition =
54 content::BrowserContext::GetStoragePartitionForSite(browser_context,
55 site_url);
56 return storage_partition;
57 }
58
46 } // namespace util 59 } // namespace util
47 } // namespace extensions 60 } // namespace extensions
OLDNEW
« 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