summaryrefslogtreecommitdiffstats
path: root/extensions/common/features
diff options
context:
space:
mode:
authorannekao <annekao@google.com>2015-08-21 16:23:53 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-21 23:24:40 +0000
commit53348222214fa3b5cf008f70566d1b3bc7d94d64 (patch)
tree19543da773b578596bd898a6161d8d70c88d877a /extensions/common/features
parentde00d08970e7ef2a95b231d605bb6a0c2c7716f4 (diff)
downloadchromium_src-53348222214fa3b5cf008f70566d1b3bc7d94d64.zip
chromium_src-53348222214fa3b5cf008f70566d1b3bc7d94d64.tar.gz
chromium_src-53348222214fa3b5cf008f70566d1b3bc7d94d64.tar.bz2
[Extension ServiceWorkers] Adding getBackgroundClient
After the v8::Context for a service worker is passed up, a script is injected in order for the service worker to have access to the background page of the extension. BUG=501569 Review URL: https://codereview.chromium.org/1304663003 Cr-Commit-Position: refs/heads/master@{#344900}
Diffstat (limited to 'extensions/common/features')
-rw-r--r--extensions/common/features/feature.h3
-rw-r--r--extensions/common/features/simple_feature.cc2
2 files changed, 5 insertions, 0 deletions
diff --git a/extensions/common/features/feature.h b/extensions/common/features/feature.h
index 304f6cb..b9f8073 100644
--- a/extensions/common/features/feature.h
+++ b/extensions/common/features/feature.h
@@ -47,6 +47,9 @@ class Feature {
// A page within webui.
WEBUI_CONTEXT,
+
+ // A context belonging to a service worker.
+ SERVICE_WORKER_CONTEXT,
};
// The platforms the feature is supported in.
diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc
index 57d9233..4ead463 100644
--- a/extensions/common/features/simple_feature.cc
+++ b/extensions/common/features/simple_feature.cc
@@ -182,6 +182,8 @@ std::string GetDisplayName(Feature::Context context) {
return "hosted app";
case Feature::WEBUI_CONTEXT:
return "webui";
+ case Feature::SERVICE_WORKER_CONTEXT:
+ return "service worker";
}
NOTREACHED();
return "";