| 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 087ebe5ba0918e7c09be1a5ffeea2e956a7809c3..0a8854c89d2319231df6d238cab547190ba18aed 100644
|
| --- a/content/browser/service_worker/service_worker_version.h
|
| +++ b/content/browser/service_worker/service_worker_version.h
|
| @@ -39,6 +39,7 @@
|
| #include "mojo/public/cpp/bindings/interface_ptr.h"
|
| #include "services/shell/public/cpp/interface_provider.h"
|
| #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerEventResult.h"
|
| +#include "third_party/WebKit/public/platform/modules/serviceworker/service_worker.mojom.h"
|
| #include "url/gurl.h"
|
| #include "url/origin.h"
|
|
|
| @@ -60,6 +61,7 @@ class ServiceWorkerRegistration;
|
| class ServiceWorkerURLRequestJob;
|
| struct ServiceWorkerClientInfo;
|
| struct ServiceWorkerVersionInfo;
|
| +class IsolatedWorkerInstance;
|
|
|
| // This class corresponds to a specific version of a ServiceWorker
|
| // script for a given pattern. When a script is upgraded, there may be
|
| @@ -137,9 +139,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
|
| int64_t registration_id() const { return registration_id_; }
|
| const GURL& script_url() const { return script_url_; }
|
| const GURL& scope() const { return scope_; }
|
| - EmbeddedWorkerStatus running_status() const {
|
| - return embedded_worker_->status();
|
| - }
|
| + EmbeddedWorkerStatus running_status() const;
|
| ServiceWorkerVersionInfo GetInfo();
|
| Status status() const { return status_; }
|
|
|
| @@ -368,6 +368,16 @@ class CONTENT_EXPORT ServiceWorkerVersion
|
| // requests, in-progress streaming URLRequestJobs, or pending start callbacks.
|
| bool HasWork() const;
|
|
|
| + bool IsIsolatedWorker() const;
|
| + blink::mojom::IsolatedWorkerClientPtr& isolated_worker_ptr() {
|
| + return isolated_worker_client_;
|
| + }
|
| + void OnIsolatedWorkerStartFailed();
|
| + void OnIsolatedWorkerThreadStarted(
|
| + blink::mojom::IsolatedWorkerClientPtr lient);
|
| + void OnIsolatedWorkerScriptEvaluated();
|
| + void OnIsolatedWorkerStarted();
|
| +
|
| private:
|
| friend class base::RefCounted<ServiceWorkerVersion>;
|
| friend class ServiceWorkerMetrics;
|
| @@ -690,6 +700,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
|
|
|
| Status status_ = NEW;
|
| std::unique_ptr<EmbeddedWorkerInstance> embedded_worker_;
|
| + std::unique_ptr<IsolatedWorkerInstance> isolated_worker_;
|
| std::vector<StatusCallback> start_callbacks_;
|
| std::vector<StatusCallback> stop_callbacks_;
|
| std::vector<base::Closure> status_change_callbacks_;
|
| @@ -760,6 +771,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
|
| // FinishStartWorker().
|
| base::Optional<ServiceWorkerMetrics::EventType> start_worker_first_purpose_;
|
|
|
| + blink::mojom::IsolatedWorkerClientPtr isolated_worker_client_;
|
| base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
|
|
|