OLD | NEW |
1 // Copyright (c) 2010 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 ServiceProcessState::~ServiceProcessState() { | 167 ServiceProcessState::~ServiceProcessState() { |
168 #if !defined(OS_MACOSX) | 168 #if !defined(OS_MACOSX) |
169 if (shared_mem_service_data_.get()) { | 169 if (shared_mem_service_data_.get()) { |
170 shared_mem_service_data_->Delete(GetServiceProcessSharedMemName()); | 170 shared_mem_service_data_->Delete(GetServiceProcessSharedMemName()); |
171 } | 171 } |
172 #endif // !OS_MACOSX | 172 #endif // !OS_MACOSX |
173 TearDownState(); | 173 TearDownState(); |
174 } | 174 } |
175 | 175 |
176 // static | |
177 ServiceProcessState* ServiceProcessState::GetInstance() { | |
178 return Singleton<ServiceProcessState>::get(); | |
179 } | |
180 | |
181 void ServiceProcessState::SignalStopped() { | 176 void ServiceProcessState::SignalStopped() { |
182 TearDownState(); | 177 TearDownState(); |
183 shared_mem_service_data_.reset(); | 178 shared_mem_service_data_.reset(); |
184 } | 179 } |
185 | 180 |
186 #if !defined(OS_MACOSX) | 181 #if !defined(OS_MACOSX) |
187 bool ServiceProcessState::Initialize() { | 182 bool ServiceProcessState::Initialize() { |
188 if (!CreateState()) { | 183 if (!CreateState()) { |
189 return false; | 184 return false; |
190 } | 185 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 269 |
275 // The user data directory is the only other flag we currently want to | 270 // The user data directory is the only other flag we currently want to |
276 // possibly store. | 271 // possibly store. |
277 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 272 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
278 FilePath user_data_dir = | 273 FilePath user_data_dir = |
279 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); | 274 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
280 if (!user_data_dir.empty()) | 275 if (!user_data_dir.empty()) |
281 autorun_command_line_->AppendSwitchPath(switches::kUserDataDir, | 276 autorun_command_line_->AppendSwitchPath(switches::kUserDataDir, |
282 user_data_dir); | 277 user_data_dir); |
283 } | 278 } |
OLD | NEW |