OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/service/service_process.h" | 5 #include "chrome/service/service_process.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // See if we need to stay running. | 202 // See if we need to stay running. |
203 ScheduleShutdownCheck(); | 203 ScheduleShutdownCheck(); |
204 | 204 |
205 // Occasionally check to see if we need to launch the browser to get the | 205 // Occasionally check to see if we need to launch the browser to get the |
206 // policy state information. | 206 // policy state information. |
207 CloudPrintPolicyCheckIfNeeded(); | 207 CloudPrintPolicyCheckIfNeeded(); |
208 return true; | 208 return true; |
209 } | 209 } |
210 | 210 |
211 bool ServiceProcess::Teardown() { | 211 bool ServiceProcess::Teardown() { |
| 212 request_context_getter_->StartTearDown(); |
212 service_prefs_.reset(); | 213 service_prefs_.reset(); |
213 cloud_print_proxy_.reset(); | 214 cloud_print_proxy_.reset(); |
214 | 215 |
215 ipc_server_.reset(); | 216 ipc_server_.reset(); |
216 // Signal this event before shutting down the service process. That way all | 217 // Signal this event before shutting down the service process. That way all |
217 // background threads can cleanup. | 218 // background threads can cleanup. |
218 shutdown_event_.Signal(); | 219 shutdown_event_.Signal(); |
219 io_thread_.reset(); | 220 io_thread_.reset(); |
220 file_thread_.reset(); | 221 file_thread_.reset(); |
221 // The NetworkChangeNotifier must be destroyed after all other threads that | 222 // The NetworkChangeNotifier must be destroyed after all other threads that |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 if (enabled_services_ && !ipc_server_->is_client_connected()) { | 351 if (enabled_services_ && !ipc_server_->is_client_connected()) { |
351 GetCloudPrintProxy()->CheckCloudPrintProxyPolicy(); | 352 GetCloudPrintProxy()->CheckCloudPrintProxyPolicy(); |
352 } | 353 } |
353 ScheduleCloudPrintPolicyCheck(); | 354 ScheduleCloudPrintPolicyCheck(); |
354 } | 355 } |
355 | 356 |
356 ServiceProcess::~ServiceProcess() { | 357 ServiceProcess::~ServiceProcess() { |
357 Teardown(); | 358 Teardown(); |
358 g_service_process = NULL; | 359 g_service_process = NULL; |
359 } | 360 } |
OLD | NEW |