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

Side by Side Diff: base/process_util.cc

Issue 9837053: Added code for renderer to cleanly exit. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed some comments. Created 8 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
« no previous file with comments | « base/process_util.h ('k') | chrome/renderer/chrome_render_process_observer.cc » ('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) 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 "base/process_util.h" 5 #include "base/process_util.h"
6 6
7 namespace base { 7 namespace base {
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {} 10 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {}
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (executable_name_.size() > 15) { 69 if (executable_name_.size() > 15) {
70 executable_name_ = FilePath::StringType(executable_name_, 70 executable_name_ = FilePath::StringType(executable_name_,
71 executable_name_.size() - 15, 15); 71 executable_name_.size() - 15, 15);
72 } 72 }
73 #endif 73 #endif
74 } 74 }
75 75
76 NamedProcessIterator::~NamedProcessIterator() { 76 NamedProcessIterator::~NamedProcessIterator() {
77 } 77 }
78 78
79 #if defined(RENDERER_CLEAN_EXIT)
80 base::subtle::Atomic32 exit_counter;
81
82 extern void clean_exit(int return_value)
83 {
84 base::subtle::Atomic32 new_exit_counter;
85 new_exit_counter = base::subtle::
86 Barrier_AtomicIncrement(&exit_counter, (base::subtle::Atomic32)1);
87 if (new_exit_counter == 1)
88 exit(return_value);
89 else
90 pthread_exit(NULL);
91 }
92 #endif // defined(RENDERER_CLEAN_EXIT)
93
79 } // namespace base 94 } // namespace base
OLDNEW
« no previous file with comments | « base/process_util.h ('k') | chrome/renderer/chrome_render_process_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698