OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // terminate. | 251 // terminate. |
252 if (!ForceServiceProcessShutdown("", 0)) { | 252 if (!ForceServiceProcessShutdown("", 0)) { |
253 Terminate(); | 253 Terminate(); |
254 } | 254 } |
255 #else | 255 #else |
256 Terminate(); | 256 Terminate(); |
257 #endif | 257 #endif |
258 } | 258 } |
259 | 259 |
260 void ServiceProcess::Terminate() { | 260 void ServiceProcess::Terminate() { |
261 main_message_loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 261 main_message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
262 } | 262 } |
263 | 263 |
264 bool ServiceProcess::HandleClientDisconnect() { | 264 bool ServiceProcess::HandleClientDisconnect() { |
265 // If there are no enabled services or if there is an update available | 265 // If there are no enabled services or if there is an update available |
266 // we want to shutdown right away. Else we want to keep listening for | 266 // we want to shutdown right away. Else we want to keep listening for |
267 // new connections. | 267 // new connections. |
268 if (!enabled_services_ || update_available()) { | 268 if (!enabled_services_ || update_available()) { |
269 Shutdown(); | 269 Shutdown(); |
270 return false; | 270 return false; |
271 } | 271 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } else { | 361 } else { |
362 Shutdown(); | 362 Shutdown(); |
363 } | 363 } |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 ServiceProcess::~ServiceProcess() { | 367 ServiceProcess::~ServiceProcess() { |
368 Teardown(); | 368 Teardown(); |
369 g_service_process = NULL; | 369 g_service_process = NULL; |
370 } | 370 } |
OLD | NEW |