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

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: trivial fix 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 int request_id = pending_registration_callbacks_.Add(callbacks); 119 int request_id = pending_registration_callbacks_.Add(callbacks);
120 TRACE_EVENT_ASYNC_BEGIN2("ServiceWorker", 120 TRACE_EVENT_ASYNC_BEGIN2("ServiceWorker",
121 "ServiceWorkerDispatcher::RegisterServiceWorker", 121 "ServiceWorkerDispatcher::RegisterServiceWorker",
122 request_id, 122 request_id,
123 "Scope", pattern.spec(), 123 "Scope", pattern.spec(),
124 "Script URL", script_url.spec()); 124 "Script URL", script_url.spec());
125 thread_safe_sender_->Send(new ServiceWorkerHostMsg_RegisterServiceWorker( 125 thread_safe_sender_->Send(new ServiceWorkerHostMsg_RegisterServiceWorker(
126 CurrentWorkerId(), request_id, provider_id, pattern, script_url)); 126 CurrentWorkerId(), request_id, provider_id, pattern, script_url));
127 } 127 }
128 128
129 void ServiceWorkerDispatcher::UpdateServiceWorker(
130 int provider_id,
131 int64 registration_id) {
132 thread_safe_sender_->Send(new ServiceWorkerHostMsg_UpdateServiceWorker(
133 provider_id, registration_id));
134 }
135
129 void ServiceWorkerDispatcher::UnregisterServiceWorker( 136 void ServiceWorkerDispatcher::UnregisterServiceWorker(
130 int provider_id, 137 int provider_id,
131 const GURL& pattern, 138 const GURL& pattern,
132 WebServiceWorkerUnregistrationCallbacks* callbacks) { 139 WebServiceWorkerUnregistrationCallbacks* callbacks) {
133 DCHECK(callbacks); 140 DCHECK(callbacks);
134 141
135 if (pattern.possibly_invalid_spec().size() > GetMaxURLChars()) { 142 if (pattern.possibly_invalid_spec().size() > GetMaxURLChars()) {
136 scoped_ptr<WebServiceWorkerUnregistrationCallbacks> 143 scoped_ptr<WebServiceWorkerUnregistrationCallbacks>
137 owned_callbacks(callbacks); 144 owned_callbacks(callbacks);
138 std::string error_message(kServiceWorkerUnregisterErrorPrefix); 145 std::string error_message(kServiceWorkerUnregisterErrorPrefix);
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 bool adopt_handle = true; 695 bool adopt_handle = true;
689 WebServiceWorkerRegistrationImpl* registration = 696 WebServiceWorkerRegistrationImpl* registration =
690 CreateServiceWorkerRegistration(info, adopt_handle); 697 CreateServiceWorkerRegistration(info, adopt_handle);
691 registration->SetInstalling(GetServiceWorker(attrs.installing, adopt_handle)); 698 registration->SetInstalling(GetServiceWorker(attrs.installing, adopt_handle));
692 registration->SetWaiting(GetServiceWorker(attrs.waiting, adopt_handle)); 699 registration->SetWaiting(GetServiceWorker(attrs.waiting, adopt_handle));
693 registration->SetActive(GetServiceWorker(attrs.active, adopt_handle)); 700 registration->SetActive(GetServiceWorker(attrs.active, adopt_handle));
694 return registration; 701 return registration;
695 } 702 }
696 703
697 } // namespace content 704 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698