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

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

Issue 1175823002: ServiceWorker: Implement ServiceWorkerRegistration.update() (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address kinuko@'s comments Created 5 years, 6 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/service_worker_dispatcher.h" 5 #include "content/child/service_worker/service_worker_dispatcher.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 int request_id = pending_registration_callbacks_.Add(callbacks); 123 int request_id = pending_registration_callbacks_.Add(callbacks);
124 TRACE_EVENT_ASYNC_BEGIN2("ServiceWorker", 124 TRACE_EVENT_ASYNC_BEGIN2("ServiceWorker",
125 "ServiceWorkerDispatcher::RegisterServiceWorker", 125 "ServiceWorkerDispatcher::RegisterServiceWorker",
126 request_id, 126 request_id,
127 "Scope", pattern.spec(), 127 "Scope", pattern.spec(),
128 "Script URL", script_url.spec()); 128 "Script URL", script_url.spec());
129 thread_safe_sender_->Send(new ServiceWorkerHostMsg_RegisterServiceWorker( 129 thread_safe_sender_->Send(new ServiceWorkerHostMsg_RegisterServiceWorker(
130 CurrentWorkerId(), request_id, provider_id, pattern, script_url)); 130 CurrentWorkerId(), request_id, provider_id, pattern, script_url));
131 } 131 }
132 132
133 void ServiceWorkerDispatcher::UpdateServiceWorker(
134 int provider_id,
135 int64 registration_id) {
136 thread_safe_sender_->Send(new ServiceWorkerHostMsg_UpdateServiceWorker(
137 provider_id, registration_id));
138 }
139
133 void ServiceWorkerDispatcher::UnregisterServiceWorker( 140 void ServiceWorkerDispatcher::UnregisterServiceWorker(
134 int provider_id, 141 int provider_id,
135 const GURL& pattern, 142 const GURL& pattern,
136 WebServiceWorkerUnregistrationCallbacks* callbacks) { 143 WebServiceWorkerUnregistrationCallbacks* callbacks) {
137 DCHECK(callbacks); 144 DCHECK(callbacks);
138 145
139 if (pattern.possibly_invalid_spec().size() > GetMaxURLChars()) { 146 if (pattern.possibly_invalid_spec().size() > GetMaxURLChars()) {
140 scoped_ptr<WebServiceWorkerUnregistrationCallbacks> 147 scoped_ptr<WebServiceWorkerUnregistrationCallbacks>
141 owned_callbacks(callbacks); 148 owned_callbacks(callbacks);
142 std::string error_message(kServiceWorkerUnregisterErrorPrefix); 149 std::string error_message(kServiceWorkerUnregisterErrorPrefix);
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 bool adopt_handle = true; 773 bool adopt_handle = true;
767 WebServiceWorkerRegistrationImpl* registration = 774 WebServiceWorkerRegistrationImpl* registration =
768 CreateServiceWorkerRegistration(info, adopt_handle); 775 CreateServiceWorkerRegistration(info, adopt_handle);
769 registration->SetInstalling(GetServiceWorker(attrs.installing, adopt_handle)); 776 registration->SetInstalling(GetServiceWorker(attrs.installing, adopt_handle));
770 registration->SetWaiting(GetServiceWorker(attrs.waiting, adopt_handle)); 777 registration->SetWaiting(GetServiceWorker(attrs.waiting, adopt_handle));
771 registration->SetActive(GetServiceWorker(attrs.active, adopt_handle)); 778 registration->SetActive(GetServiceWorker(attrs.active, adopt_handle));
772 return registration; 779 return registration;
773 } 780 }
774 781
775 } // namespace content 782 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698