Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Unified Diff: content/child/service_worker/web_service_worker_impl.cc

Issue 249143002: ServiceWorker: Let the proxy drive state change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/service_worker/web_service_worker_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/service_worker/web_service_worker_impl.cc
diff --git a/content/child/service_worker/web_service_worker_impl.cc b/content/child/service_worker/web_service_worker_impl.cc
index 626aa0bd31b5b376594627403f95b91e6c6fd964..74fe887571f8b04b64af7bd30de6e1d2d7d25e83 100644
--- a/content/child/service_worker/web_service_worker_impl.cc
+++ b/content/child/service_worker/web_service_worker_impl.cc
@@ -44,17 +44,14 @@ WebServiceWorkerImpl::~WebServiceWorkerImpl() {
dispatcher->RemoveServiceWorker(handle_id_);
}
-void WebServiceWorkerImpl::SetState(blink::WebServiceWorkerState new_state) {
- state_ = new_state;
- if (!proxy_)
- return;
- proxy_->dispatchStateChangeEvent();
-}
-
void WebServiceWorkerImpl::setProxy(blink::WebServiceWorkerProxy* proxy) {
proxy_ = proxy;
}
+void WebServiceWorkerImpl::setState(blink::WebServiceWorkerState new_state) {
+ state_ = new_state;
+}
+
blink::WebURL WebServiceWorkerImpl::scope() const {
return scope_;
}
@@ -75,4 +72,10 @@ void WebServiceWorkerImpl::postMessage(const WebString& message,
WebMessagePortChannelImpl::ExtractMessagePortIDs(channels)));
}
+void WebServiceWorkerImpl::OnStateChanged(
+ blink::WebServiceWorkerState new_state) {
+ DCHECK(proxy_);
+ proxy_->onStateChanged(new_state);
+}
+
} // namespace content
« no previous file with comments | « content/child/service_worker/web_service_worker_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698