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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 protected: | 56 protected: |
57 virtual void CleanUp(); | 57 virtual void CleanUp(); |
58 | 58 |
59 private: | 59 private: |
60 DISALLOW_COPY_AND_ASSIGN(ServiceIOThread); | 60 DISALLOW_COPY_AND_ASSIGN(ServiceIOThread); |
61 }; | 61 }; |
62 | 62 |
63 ServiceIOThread::ServiceIOThread(const char* name) : base::Thread(name) {} | 63 ServiceIOThread::ServiceIOThread(const char* name) : base::Thread(name) {} |
64 ServiceIOThread::~ServiceIOThread() { | 64 ServiceIOThread::~ServiceIOThread() { |
65 // We cannot rely on our base class to stop the thread since we want our | |
66 // CleanUp function to run. | |
67 Stop(); | 65 Stop(); |
68 } | 66 } |
69 | 67 |
70 void ServiceIOThread::CleanUp() { | 68 void ServiceIOThread::CleanUp() { |
71 content::URLFetcher::CancelAll(); | 69 content::URLFetcher::CancelAll(); |
72 } | 70 } |
73 | 71 |
74 // Prepares the localized strings that are going to be displayed to | 72 // Prepares the localized strings that are going to be displayed to |
75 // the user if the service process dies. These strings are stored in the | 73 // the user if the service process dies. These strings are stored in the |
76 // environment block so they are accessible in the early stages of the | 74 // environment block so they are accessible in the early stages of the |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 } else { | 360 } else { |
363 Shutdown(); | 361 Shutdown(); |
364 } | 362 } |
365 } | 363 } |
366 } | 364 } |
367 | 365 |
368 ServiceProcess::~ServiceProcess() { | 366 ServiceProcess::~ServiceProcess() { |
369 Teardown(); | 367 Teardown(); |
370 g_service_process = NULL; | 368 g_service_process = NULL; |
371 } | 369 } |
OLD | NEW |