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 57ac26103f94e93dbb8a8c7dc900aa3961bce276..701e08adb06ad5756c52665fca512ca69f38ae92 100644 |
| --- a/content/browser/service_worker/service_worker_version.h |
| +++ b/content/browser/service_worker/service_worker_version.h |
| @@ -427,6 +427,36 @@ class CONTENT_EXPORT ServiceWorkerVersion |
| void NotifyMainScriptJobCreated( |
| ServiceWorkerContextRequestHandler::CreateJobStatus status); |
| + // Returns true if the service worker should support Navigation Preload. |
| + // There are three possible states: |
| + // - A: Navigation Preload related methods and attributes are available in JS |
| + // and work correctly. |
| + // - B: Navigation Preload related methods and attributes are available in |
| + // JS. But NavigationPreloadManager's enable, disable and setHeaderValue |
| + // methods always return a rejected promise. And FetchEvent's |
| + // preloadResponse attribute returns a promise which always resolve with |
| + // undefined. |
| + // - C: Navigation Preload related methods and attributes are not available |
| + // in JS. |
| + // This method returns true only for A case. |
| + // blink::OriginTrials::serviceWorkerNavigationPreloadEnabled() returns true |
| + // for both A and B case. |
| + // |
| + // * Origin Trial: Have an effective header. |
| + // Command line |
| + // Default Enable Disabled |
| + // Default B A B |
| + // Field trial Enabled A A B |
| + // Disabled B A B |
| + // |
| + // * Origin Trial: No header. |
| + // Command line |
| + // Default Enable Disabled |
| + // Default C A C |
| + // Field trial Enabled C A C |
| + // Disabled C A C |
|
falken
2017/01/13 03:43:41
Great comment.
|
| + bool IsNavigationPreloadSupported() const; |
| + |
| private: |
| friend class base::RefCounted<ServiceWorkerVersion>; |
| friend class ServiceWorkerMetrics; |