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

Side by Side Diff: content/child/service_worker/web_service_worker_impl.cc

Issue 517493002: ServiceWorker: Update the install sequence as per the latest spec (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment fix (+rebase) Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/service_worker/web_service_worker_impl.h" 5 #include "content/child/service_worker/web_service_worker_impl.h"
6 6
7 #include "content/child/service_worker/service_worker_dispatcher.h" 7 #include "content/child/service_worker/service_worker_dispatcher.h"
8 #include "content/child/service_worker/service_worker_handle_reference.h" 8 #include "content/child/service_worker/service_worker_handle_reference.h"
9 #include "content/child/thread_safe_sender.h" 9 #include "content/child/thread_safe_sender.h"
10 #include "content/child/webmessageportchannel_impl.h" 10 #include "content/child/webmessageportchannel_impl.h"
(...skipping 25 matching lines...) Expand all
36 if (handle_ref_->handle_id() == kInvalidServiceWorkerHandleId) 36 if (handle_ref_->handle_id() == kInvalidServiceWorkerHandleId)
37 return; 37 return;
38 ServiceWorkerDispatcher* dispatcher = 38 ServiceWorkerDispatcher* dispatcher =
39 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 39 ServiceWorkerDispatcher::GetThreadSpecificInstance();
40 if (dispatcher) 40 if (dispatcher)
41 dispatcher->RemoveServiceWorker(handle_ref_->handle_id()); 41 dispatcher->RemoveServiceWorker(handle_ref_->handle_id());
42 } 42 }
43 43
44 void WebServiceWorkerImpl::OnStateChanged( 44 void WebServiceWorkerImpl::OnStateChanged(
45 blink::WebServiceWorkerState new_state) { 45 blink::WebServiceWorkerState new_state) {
46 DCHECK(proxy_); 46 if (proxy_ && proxy_->isReady())
47 if (proxy_->isReady())
48 CommitState(new_state); 47 CommitState(new_state);
49 else 48 else
50 queued_states_.push_back(new_state); 49 queued_states_.push_back(new_state);
51 } 50 }
52 51
53 void WebServiceWorkerImpl::setProxy(blink::WebServiceWorkerProxy* proxy) { 52 void WebServiceWorkerImpl::setProxy(blink::WebServiceWorkerProxy* proxy) {
54 proxy_ = proxy; 53 proxy_ = proxy;
55 } 54 }
56 55
57 blink::WebServiceWorkerProxy* WebServiceWorkerImpl::proxy() { 56 blink::WebServiceWorkerProxy* WebServiceWorkerImpl::proxy() {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 90 }
92 91
93 void WebServiceWorkerImpl::CommitState(blink::WebServiceWorkerState new_state) { 92 void WebServiceWorkerImpl::CommitState(blink::WebServiceWorkerState new_state) {
94 DCHECK(proxy_); 93 DCHECK(proxy_);
95 DCHECK(proxy_->isReady()); 94 DCHECK(proxy_->isReady());
96 state_ = new_state; 95 state_ = new_state;
97 proxy_->dispatchStateChangeEvent(); 96 proxy_->dispatchStateChangeEvent();
98 } 97 }
99 98
100 } // namespace content 99 } // namespace content
OLDNEW
« no previous file with comments | « content/child/service_worker/service_worker_message_filter.cc ('k') | content/common/service_worker/service_worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698