OLD | NEW |
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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 render_thread_id_(kDocumentMainThreadId), | 101 render_thread_id_(kDocumentMainThreadId), |
102 provider_id_(provider_id), | 102 provider_id_(provider_id), |
103 provider_type_(provider_type), | 103 provider_type_(provider_type), |
104 context_(context), | 104 context_(context), |
105 dispatcher_host_(dispatcher_host), | 105 dispatcher_host_(dispatcher_host), |
106 allow_association_(true) { | 106 allow_association_(true) { |
107 DCHECK_NE(SERVICE_WORKER_PROVIDER_UNKNOWN, provider_type_); | 107 DCHECK_NE(SERVICE_WORKER_PROVIDER_UNKNOWN, provider_type_); |
108 DCHECK_NE(SERVICE_WORKER_PROVIDER_FOR_SANDBOXED_FRAME, provider_type_); | 108 DCHECK_NE(SERVICE_WORKER_PROVIDER_FOR_SANDBOXED_FRAME, provider_type_); |
109 | 109 |
110 // PlzNavigate | 110 // PlzNavigate |
111 CHECK_IMPLIES(render_process_id == ChildProcessHost::kInvalidUniqueID, | 111 CHECK(render_process_id != ChildProcessHost::kInvalidUniqueID || |
112 base::CommandLine::ForCurrentProcess()->HasSwitch( | 112 base::CommandLine::ForCurrentProcess()->HasSwitch( |
113 switches::kEnableBrowserSideNavigation)); | 113 switches::kEnableBrowserSideNavigation)); |
114 | 114 |
115 if (provider_type_ == SERVICE_WORKER_PROVIDER_FOR_CONTROLLER) { | 115 if (provider_type_ == SERVICE_WORKER_PROVIDER_FOR_CONTROLLER) { |
116 // Actual thread id is set when the service worker context gets started. | 116 // Actual thread id is set when the service worker context gets started. |
117 render_thread_id_ = kInvalidEmbeddedWorkerThreadId; | 117 render_thread_id_ = kInvalidEmbeddedWorkerThreadId; |
118 } | 118 } |
119 context_->RegisterProviderHostByClientID(client_uuid_, this); | 119 context_->RegisterProviderHostByClientID(client_uuid_, this); |
120 } | 120 } |
121 | 121 |
122 ServiceWorkerProviderHost::~ServiceWorkerProviderHost() { | 122 ServiceWorkerProviderHost::~ServiceWorkerProviderHost() { |
123 if (context_) | 123 if (context_) |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 Send(new ServiceWorkerMsg_SetControllerServiceWorker( | 728 Send(new ServiceWorkerMsg_SetControllerServiceWorker( |
729 render_thread_id_, provider_id(), | 729 render_thread_id_, provider_id(), |
730 GetOrCreateServiceWorkerHandle( | 730 GetOrCreateServiceWorkerHandle( |
731 associated_registration_->active_version()), | 731 associated_registration_->active_version()), |
732 false /* shouldNotifyControllerChange */)); | 732 false /* shouldNotifyControllerChange */)); |
733 } | 733 } |
734 } | 734 } |
735 } | 735 } |
736 | 736 |
737 } // namespace content | 737 } // namespace content |
OLD | NEW |