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_dispatcher_host.h" | 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (GetContext()) { | 102 if (GetContext()) { |
103 GetContext()->RemoveAllProviderHostsForProcess(render_process_id_); | 103 GetContext()->RemoveAllProviderHostsForProcess(render_process_id_); |
104 GetContext()->embedded_worker_registry()->RemoveChildProcessSender( | 104 GetContext()->embedded_worker_registry()->RemoveChildProcessSender( |
105 render_process_id_); | 105 render_process_id_); |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 void ServiceWorkerDispatcherHost::Init( | 109 void ServiceWorkerDispatcherHost::Init( |
110 ServiceWorkerContextWrapper* context_wrapper) { | 110 ServiceWorkerContextWrapper* context_wrapper) { |
111 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 111 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
112 BrowserThread::PostTask( | 112 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
113 BrowserThread::IO, FROM_HERE, | 113 base::Bind(&ServiceWorkerDispatcherHost::Init, this, |
114 base::Bind(&ServiceWorkerDispatcherHost::Init, | 114 base::RetainedRef(context_wrapper))); |
115 this, make_scoped_refptr(context_wrapper))); | |
116 return; | 115 return; |
117 } | 116 } |
118 | 117 |
119 context_wrapper_ = context_wrapper; | 118 context_wrapper_ = context_wrapper; |
120 if (!GetContext()) | 119 if (!GetContext()) |
121 return; | 120 return; |
122 GetContext()->embedded_worker_registry()->AddChildProcessSender( | 121 GetContext()->embedded_worker_registry()->AddChildProcessSender( |
123 render_process_id_, this, message_port_message_filter_); | 122 render_process_id_, this, message_port_message_filter_); |
124 } | 123 } |
125 | 124 |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 if (!handle) { | 1389 if (!handle) { |
1391 bad_message::ReceivedBadMessage(this, | 1390 bad_message::ReceivedBadMessage(this, |
1392 bad_message::SWDH_TERMINATE_BAD_HANDLE); | 1391 bad_message::SWDH_TERMINATE_BAD_HANDLE); |
1393 return; | 1392 return; |
1394 } | 1393 } |
1395 handle->version()->StopWorker( | 1394 handle->version()->StopWorker( |
1396 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 1395 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
1397 } | 1396 } |
1398 | 1397 |
1399 } // namespace content | 1398 } // namespace content |
OLD | NEW |