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

Side by Side Diff: content/browser/service_worker/service_worker_provider_host.cc

Issue 2023733002: service worker: Remove unused PROVIDER_FOR_SANDBOXED_IFRAME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/browser/service_worker/service_worker_provider_host.h" 5 #include "content/browser/service_worker/service_worker_provider_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 : client_uuid_(base::GenerateGUID()), 67 : client_uuid_(base::GenerateGUID()),
68 render_process_id_(render_process_id), 68 render_process_id_(render_process_id),
69 route_id_(route_id), 69 route_id_(route_id),
70 render_thread_id_(kDocumentMainThreadId), 70 render_thread_id_(kDocumentMainThreadId),
71 provider_id_(provider_id), 71 provider_id_(provider_id),
72 provider_type_(provider_type), 72 provider_type_(provider_type),
73 context_(context), 73 context_(context),
74 dispatcher_host_(dispatcher_host), 74 dispatcher_host_(dispatcher_host),
75 allow_association_(true) { 75 allow_association_(true) {
76 DCHECK_NE(SERVICE_WORKER_PROVIDER_UNKNOWN, provider_type_); 76 DCHECK_NE(SERVICE_WORKER_PROVIDER_UNKNOWN, provider_type_);
77 DCHECK_NE(SERVICE_WORKER_PROVIDER_FOR_SANDBOXED_FRAME, provider_type_);
78 77
79 // PlzNavigate 78 // PlzNavigate
80 CHECK(render_process_id != ChildProcessHost::kInvalidUniqueID || 79 CHECK(render_process_id != ChildProcessHost::kInvalidUniqueID ||
81 IsBrowserSideNavigationEnabled()); 80 IsBrowserSideNavigationEnabled());
82 81
83 if (provider_type_ == SERVICE_WORKER_PROVIDER_FOR_CONTROLLER) { 82 if (provider_type_ == SERVICE_WORKER_PROVIDER_FOR_CONTROLLER) {
84 // Actual thread id is set when the service worker context gets started. 83 // Actual thread id is set when the service worker context gets started.
85 render_thread_id_ = kInvalidEmbeddedWorkerThreadId; 84 render_thread_id_ = kInvalidEmbeddedWorkerThreadId;
86 } 85 }
87 context_->RegisterProviderHostByClientID(client_uuid_, this); 86 context_->RegisterProviderHostByClientID(client_uuid_, this);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 204 }
206 205
207 bool ServiceWorkerProviderHost::IsProviderForClient() const { 206 bool ServiceWorkerProviderHost::IsProviderForClient() const {
208 switch (provider_type_) { 207 switch (provider_type_) {
209 case SERVICE_WORKER_PROVIDER_FOR_WINDOW: 208 case SERVICE_WORKER_PROVIDER_FOR_WINDOW:
210 case SERVICE_WORKER_PROVIDER_FOR_WORKER: 209 case SERVICE_WORKER_PROVIDER_FOR_WORKER:
211 case SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER: 210 case SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER:
212 return true; 211 return true;
213 case SERVICE_WORKER_PROVIDER_FOR_CONTROLLER: 212 case SERVICE_WORKER_PROVIDER_FOR_CONTROLLER:
214 return false; 213 return false;
215 case SERVICE_WORKER_PROVIDER_FOR_SANDBOXED_FRAME:
216 case SERVICE_WORKER_PROVIDER_UNKNOWN: 214 case SERVICE_WORKER_PROVIDER_UNKNOWN:
217 NOTREACHED() << provider_type_; 215 NOTREACHED() << provider_type_;
218 } 216 }
219 NOTREACHED() << provider_type_; 217 NOTREACHED() << provider_type_;
220 return false; 218 return false;
221 } 219 }
222 220
223 blink::WebServiceWorkerClientType ServiceWorkerProviderHost::client_type() 221 blink::WebServiceWorkerClientType ServiceWorkerProviderHost::client_type()
224 const { 222 const {
225 switch (provider_type_) { 223 switch (provider_type_) {
226 case SERVICE_WORKER_PROVIDER_FOR_WINDOW: 224 case SERVICE_WORKER_PROVIDER_FOR_WINDOW:
227 return blink::WebServiceWorkerClientTypeWindow; 225 return blink::WebServiceWorkerClientTypeWindow;
228 case SERVICE_WORKER_PROVIDER_FOR_WORKER: 226 case SERVICE_WORKER_PROVIDER_FOR_WORKER:
229 return blink::WebServiceWorkerClientTypeWorker; 227 return blink::WebServiceWorkerClientTypeWorker;
230 case SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER: 228 case SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER:
231 return blink::WebServiceWorkerClientTypeSharedWorker; 229 return blink::WebServiceWorkerClientTypeSharedWorker;
232 case SERVICE_WORKER_PROVIDER_FOR_CONTROLLER: 230 case SERVICE_WORKER_PROVIDER_FOR_CONTROLLER:
233 case SERVICE_WORKER_PROVIDER_FOR_SANDBOXED_FRAME:
234 case SERVICE_WORKER_PROVIDER_UNKNOWN: 231 case SERVICE_WORKER_PROVIDER_UNKNOWN:
235 NOTREACHED() << provider_type_; 232 NOTREACHED() << provider_type_;
236 } 233 }
237 NOTREACHED() << provider_type_; 234 NOTREACHED() << provider_type_;
238 return blink::WebServiceWorkerClientTypeWindow; 235 return blink::WebServiceWorkerClientTypeWindow;
239 } 236 }
240 237
241 void ServiceWorkerProviderHost::AssociateRegistration( 238 void ServiceWorkerProviderHost::AssociateRegistration(
242 ServiceWorkerRegistration* registration, 239 ServiceWorkerRegistration* registration,
243 bool notify_controllerchange) { 240 bool notify_controllerchange) {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 Send(new ServiceWorkerMsg_SetControllerServiceWorker( 643 Send(new ServiceWorkerMsg_SetControllerServiceWorker(
647 render_thread_id_, provider_id(), 644 render_thread_id_, provider_id(),
648 GetOrCreateServiceWorkerHandle( 645 GetOrCreateServiceWorkerHandle(
649 associated_registration_->active_version()), 646 associated_registration_->active_version()),
650 false /* shouldNotifyControllerChange */)); 647 false /* shouldNotifyControllerChange */));
651 } 648 }
652 } 649 }
653 } 650 }
654 651
655 } // namespace content 652 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698