Chromium Code Reviews| Index: content/public/browser/service_worker_context.h |
| diff --git a/content/public/browser/service_worker_context.h b/content/public/browser/service_worker_context.h |
| index e035fbec34ed0a4213bce2dcce0ffdae2c55f83a..e6e1455db7b314b2fdd90ef39657a6ec16a45b9a 100644 |
| --- a/content/public/browser/service_worker_context.h |
| +++ b/content/public/browser/service_worker_context.h |
| @@ -5,6 +5,10 @@ |
| #ifndef CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ |
| #define CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CONTEXT_H_ |
| +#include <set> |
| +#include <string> |
| +#include <vector> |
| + |
| #include "base/basictypes.h" |
| #include "base/callback_forward.h" |
| #include "content/public/browser/service_worker_usage_info.h" |
| @@ -13,7 +17,7 @@ |
| namespace content { |
| // Represents the per-StoragePartition ServiceWorker data. Must be used from |
| -// the IO thread. |
| +// the IO thread except for AddExcludedHeadersForFetchEvent. |
| class ServiceWorkerContext { |
| public: |
| // https://rawgithub.com/slightlyoff/ServiceWorker/master/spec/service_worker/index.html#url-scope: |
| @@ -25,6 +29,13 @@ class ServiceWorkerContext { |
| typedef base::Callback<void(const std::vector<ServiceWorkerUsageInfo>& |
| usage_info)> GetUsageInfoCallback; |
| + // Registers the header name which should not be passed to the ServiceWorker. |
| + CONTENT_EXPORT static void AddExcludedHeadersForFetchEvent( |
| + const std::vector<std::string> header_names); |
|
michaeln
2014/10/28 20:57:22
can this be a const ref?
horo
2014/10/29 01:56:25
Done.
|
| + |
| + // Returns true if the header name should not be passed to the ServiceWorker. |
| + static bool IsExcludedHeaderNameForFetchEvent(const std::string& header_name); |
| + |
| // Equivalent to calling navigator.serviceWorker.register(script_url, {scope: |
| // pattern}) from a renderer, except that |pattern| is an absolute URL instead |
| // of relative to some current origin. |callback| is passed true when the JS |