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

Side by Side Diff: chrome/browser/child_process_launcher.cc

Issue 6142009: Upating the app, ceee, chrome, ipc, media, and net directories to use the correct lock.h file. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Unified patch updating all references to the new base/synchronization/lock.h Created 9 years, 11 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/browser/cert_store.cc ('k') | chrome/browser/child_process_security_policy.h » ('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) 2010 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/browser/child_process_launcher.h" 5 #include "chrome/browser/child_process_launcher.h"
6 6
7 #include <utility> // For std::pair. 7 #include <utility> // For std::pair.
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lock.h"
11 #include "base/logging.h" 10 #include "base/logging.h"
12 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
12 #include "base/synchronization/lock.h"
13 #include "base/threading/thread.h" 13 #include "base/threading/thread.h"
14 #include "chrome/browser/browser_thread.h" 14 #include "chrome/browser/browser_thread.h"
15 #include "chrome/common/chrome_descriptors.h" 15 #include "chrome/common/chrome_descriptors.h"
16 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
17 #include "chrome/common/process_watcher.h" 17 #include "chrome/common/process_watcher.h"
18 #include "chrome/common/result_codes.h" 18 #include "chrome/common/result_codes.h"
19 19
20 #if defined(OS_WIN) 20 #if defined(OS_WIN)
21 #include "base/file_path.h" 21 #include "base/file_path.h"
22 #include "chrome/common/sandbox_policy.h" 22 #include "chrome/common/sandbox_policy.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 bool launched = false; 168 bool launched = false;
169 #if defined(OS_MACOSX) 169 #if defined(OS_MACOSX)
170 // It is possible for the child process to die immediately after 170 // It is possible for the child process to die immediately after
171 // launching. To prevent leaking MachBroker map entries in this case, 171 // launching. To prevent leaking MachBroker map entries in this case,
172 // lock around all of LaunchApp(). If the child dies, the death 172 // lock around all of LaunchApp(). If the child dies, the death
173 // notification will be processed by the MachBroker after the call to 173 // notification will be processed by the MachBroker after the call to
174 // AddPlaceholderForPid(), enabling proper cleanup. 174 // AddPlaceholderForPid(), enabling proper cleanup.
175 { // begin scope for AutoLock 175 { // begin scope for AutoLock
176 MachBroker* broker = MachBroker::GetInstance(); 176 MachBroker* broker = MachBroker::GetInstance();
177 AutoLock lock(broker->GetLock()); 177 base::AutoLock lock(broker->GetLock());
178 178
179 // This call to |PrepareForFork()| will start the MachBroker listener 179 // This call to |PrepareForFork()| will start the MachBroker listener
180 // thread, if it is not already running. Therefore the browser process 180 // thread, if it is not already running. Therefore the browser process
181 // will be listening for Mach IPC before LaunchApp() is called. 181 // will be listening for Mach IPC before LaunchApp() is called.
182 broker->PrepareForFork(); 182 broker->PrepareForFork();
183 #endif 183 #endif
184 // Actually launch the app. 184 // Actually launch the app.
185 launched = base::LaunchApp(cmd_line->argv(), env, fds_to_map, 185 launched = base::LaunchApp(cmd_line->argv(), env, fds_to_map,
186 /* wait= */false, &handle); 186 /* wait= */false, &handle);
187 #if defined(OS_MACOSX) 187 #if defined(OS_MACOSX)
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 if (status != base::TERMINATION_STATUS_STILL_RUNNING) 333 if (status != base::TERMINATION_STATUS_STILL_RUNNING)
334 context_->process_.Close(); 334 context_->process_.Close();
335 335
336 return status; 336 return status;
337 } 337 }
338 338
339 void ChildProcessLauncher::SetProcessBackgrounded(bool background) { 339 void ChildProcessLauncher::SetProcessBackgrounded(bool background) {
340 DCHECK(!context_->starting_); 340 DCHECK(!context_->starting_);
341 context_->process_.SetProcessBackgrounded(background); 341 context_->process_.SetProcessBackgrounded(background);
342 } 342 }
OLDNEW
« no previous file with comments | « chrome/browser/cert_store.cc ('k') | chrome/browser/child_process_security_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698