Chromium Code Reviews| Index: content/child/service_worker/web_service_worker_impl.h |
| diff --git a/content/child/service_worker/web_service_worker_impl.h b/content/child/service_worker/web_service_worker_impl.h |
| index f6e00a1bcbc8685c093972fc43f2dc033ca69ee8..cf9728e5cbfffc7fb0f93bb1d5fa5b83fcae4556 100644 |
| --- a/content/child/service_worker/web_service_worker_impl.h |
| +++ b/content/child/service_worker/web_service_worker_impl.h |
| @@ -5,6 +5,8 @@ |
| #ifndef CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_IMPL_H_ |
| #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_IMPL_H_ |
| +#include <vector> |
| + |
| #include "base/compiler_specific.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/strings/string16.h" |
| @@ -28,9 +30,13 @@ class WebServiceWorkerImpl |
| ThreadSafeSender* thread_safe_sender); |
| virtual ~WebServiceWorkerImpl(); |
| - void SetState(blink::WebServiceWorkerState new_state); |
| + // Notifies that the service worker's state changed. This function may queue |
| + // the state change for later processing, if the proxy is not yet ready to |
| + // handle state changes. |
| + void OnStateChanged(blink::WebServiceWorkerState new_state); |
| virtual void setProxy(blink::WebServiceWorkerProxy* proxy); |
| + virtual void proxyReadyChanged(); |
| virtual blink::WebURL scope() const; |
| virtual blink::WebURL url() const; |
| virtual blink::WebServiceWorkerState state() const; |
| @@ -38,12 +44,16 @@ class WebServiceWorkerImpl |
| blink::WebMessagePortChannelArray* channels); |
| private: |
| + // Commits the new state internally and notifies the proxy of the change. |
| + void ChangeState(blink::WebServiceWorkerState new_state); |
|
kinuko
2014/04/25 08:07:34
nit: CommitStateChange() maybe, to clearly disting
falken
2014/04/27 03:31:17
I agree. Unfortunately I can't remote into my comp
|
| + |
| const int handle_id_; |
| const GURL scope_; |
| const GURL url_; |
| blink::WebServiceWorkerState state_; |
| scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| blink::WebServiceWorkerProxy* proxy_; |
| + std::vector<blink::WebServiceWorkerState> queued_states_; |
| DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerImpl); |
| }; |