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

Side by Side Diff: base/process/process_win.cc

Issue 2629623003: Win should call ::TerminateProcess to exit a renderer process (Closed)
Patch Set: temp Created 3 years, 10 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/process_unittest.cc ('k') | content/renderer/render_thread_impl.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/process.h" 5 #include "base/process/process.h"
6 6
7 #include "base/debug/activity_tracker.h" 7 #include "base/debug/activity_tracker.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "base/process/kill.h" 10 #include "base/process/kill.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return Process(); 75 return Process();
76 } 76 }
77 return Process(out_handle); 77 return Process(out_handle);
78 } 78 }
79 79
80 // static 80 // static
81 bool Process::CanBackgroundProcesses() { 81 bool Process::CanBackgroundProcesses() {
82 return true; 82 return true;
83 } 83 }
84 84
85 // static
86 void Process::TerminateCurrentProcessImmediately(int exit_code) {
87 ::TerminateProcess(GetCurrentProcess(), exit_code);
88 }
89
85 bool Process::IsValid() const { 90 bool Process::IsValid() const {
86 return process_.IsValid() || is_current(); 91 return process_.IsValid() || is_current();
87 } 92 }
88 93
89 ProcessHandle Process::Handle() const { 94 ProcessHandle Process::Handle() const {
90 return is_current_process_ ? GetCurrentProcess() : process_.Get(); 95 return is_current_process_ ? GetCurrentProcess() : process_.Get();
91 } 96 }
92 97
93 Process Process::Duplicate() const { 98 Process Process::Duplicate() const {
94 if (is_current()) 99 if (is_current())
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 189
185 return (::SetPriorityClass(Handle(), priority) != 0); 190 return (::SetPriorityClass(Handle(), priority) != 0);
186 } 191 }
187 192
188 int Process::GetPriority() const { 193 int Process::GetPriority() const {
189 DCHECK(IsValid()); 194 DCHECK(IsValid());
190 return ::GetPriorityClass(Handle()); 195 return ::GetPriorityClass(Handle());
191 } 196 }
192 197
193 } // namespace base 198 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process_unittest.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698