Chromium Code Reviews| Index: content/browser/service_worker/service_worker_version.h |
| diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h |
| index 5026700bcbe09f5a78f3a83a27c1700d9fe29a70..8922549bc781a8074e1a3ee5bf8c56a53b7892da 100644 |
| --- a/content/browser/service_worker/service_worker_version.h |
| +++ b/content/browser/service_worker/service_worker_version.h |
| @@ -33,6 +33,7 @@ |
| #include "content/browser/service_worker/service_worker_metrics.h" |
| #include "content/browser/service_worker/service_worker_script_cache_map.h" |
| #include "content/common/content_export.h" |
| +#include "content/common/origin_trials/trial_token_validator.h" |
| #include "content/common/service_worker/service_worker_status_code.h" |
| #include "content/common/service_worker/service_worker_types.h" |
| #include "ipc/ipc_message.h" |
| @@ -353,6 +354,19 @@ class CONTENT_EXPORT ServiceWorkerVersion |
| pause_after_download_ = pause_after_download; |
| } |
| + // Returns nullptr if the main script is not loaded yet and: |
| + // 1) The worer is a new one. |
|
falken
2016/10/07 03:35:22
nit: worker
horo
2016/10/07 05:33:32
Done.
|
| + // OR |
| + // 2) The worker is an existing one but the entry in ServiceWorkerDatabase |
| + // was written by old version Chrome, so |origin_trial_tokens| wasn't set |
|
falken
2016/10/07 03:35:22
and old version of Chrome (< M55)
horo
2016/10/07 05:33:32
Done.
|
| + // in the entry. |
| + const TrialTokenValidator::FeatureToTokensMap* origin_trial_tokens() const { |
| + return origin_trial_tokens_.get(); |
| + } |
| + // Set valid tokens in |tokens|. Invalid tokens in |tokens| are ignored. |
| + void SetValidOriginTrialTokens( |
| + const TrialTokenValidator::FeatureToTokensMap& tokens); |
| + |
| void SetDevToolsAttached(bool attached); |
| // Sets the HttpResponseInfo used to load the main script. |
| @@ -748,6 +762,8 @@ class CONTENT_EXPORT ServiceWorkerVersion |
| std::vector<int> pending_skip_waiting_requests_; |
| std::unique_ptr<net::HttpResponseInfo> main_script_http_info_; |
| + std::unique_ptr<TrialTokenValidator::FeatureToTokensMap> origin_trial_tokens_; |
| + |
| // If not OK, the reason that StartWorker failed. Used for |
| // running |start_callbacks_|. |
| ServiceWorkerStatusCode start_worker_status_ = SERVICE_WORKER_OK; |