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

Unified Diff: extensions/common/manifest_handlers/background_info.h

Issue 178253007: Parse manifest file with app.service_worker.script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved test utils out of base Created 6 years, 10 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/common/manifest_constants.cc ('k') | extensions/common/manifest_handlers/background_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/manifest_handlers/background_info.h
diff --git a/extensions/common/manifest_handlers/background_info.h b/extensions/common/manifest_handlers/background_info.h
index e9e360e696306160376a52b709ba8561c3bae2d7..947ee650ab2f85accb9068e21d14f4f619195a8d 100644
--- a/extensions/common/manifest_handlers/background_info.h
+++ b/extensions/common/manifest_handlers/background_info.h
@@ -23,10 +23,12 @@ class BackgroundInfo : public Extension::ManifestData {
static GURL GetBackgroundURL(const Extension* extension);
static const std::vector<std::string>& GetBackgroundScripts(
const Extension* extension);
+ static const std::string& GetServiceWorkerScript(const Extension* extension);
static bool HasBackgroundPage(const Extension* extension);
static bool HasPersistentBackgroundPage(const Extension* extension);
static bool HasLazyBackgroundPage(const Extension* extension);
static bool HasGeneratedBackgroundPage(const Extension* extension);
+ static bool HasServiceWorker(const Extension* extension);
static bool AllowJSAccess(const Extension* extension);
bool has_background_page() const {
@@ -41,9 +43,14 @@ class BackgroundInfo : public Extension::ManifestData {
return has_background_page() && !is_persistent_;
}
+ bool has_service_worker() const { return !service_worker_script_.empty(); }
+
bool Parse(const Extension* extension, base::string16* error);
private:
+ bool LoadServiceWorkerScript(const Extension* extension,
+ const std::string& key,
+ base::string16* error);
bool LoadBackgroundScripts(const Extension* extension,
const std::string& key,
base::string16* error);
@@ -67,6 +74,10 @@ class BackgroundInfo : public Extension::ManifestData {
// load on-demand (when it needs to handle an event). Defaults to true.
bool is_persistent_;
+ // Optional script to register as a service worker. This is mutually exclusive
+ // to the use of background_url_ or background_scripts_.
+ std::string service_worker_script_;
+
// True if the background page can be scripted by pages of the app or
// extension, in which case all such pages must run in the same process.
// False if such pages are not permitted to script the background page,
« no previous file with comments | « extensions/common/manifest_constants.cc ('k') | extensions/common/manifest_handlers/background_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698