Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Side by Side Diff: chrome/common/service_process_util.cc

Issue 6660001: Getting service process on Mac to handle having things moved/changed underneath it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: polishing the chrome Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/service_process_util.h ('k') | chrome/common/service_process_util_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/common/service_process_util.h ('k') | chrome/common/service_process_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698