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

Side by Side Diff: chrome/test/chrome_process_util.cc

Issue 5172009: This adds some plumbing for propagating the reason for a renderer's death (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final review changes Created 10 years 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/result_codes.h ('k') | no next file » | 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/test/chrome_process_util.h" 5 #include "chrome/test/chrome_process_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include <set> 8 #include <set>
9 9
10 #include "base/process_util.h" 10 #include "base/process_util.h"
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "chrome/common/chrome_constants.h" 12 #include "chrome/common/chrome_constants.h"
13 #include "chrome/common/result_codes.h" 13 #include "chrome/common/result_codes.h"
14 14
15 using base::TimeDelta; 15 using base::TimeDelta;
16 using base::TimeTicks; 16 using base::TimeTicks;
17 17
18 void TerminateAllChromeProcesses(base::ProcessId browser_pid) { 18 void TerminateAllChromeProcesses(base::ProcessId browser_pid) {
19 ChromeProcessList process_pids(GetRunningChromeProcesses(browser_pid)); 19 ChromeProcessList process_pids(GetRunningChromeProcesses(browser_pid));
20 20
21 ChromeProcessList::const_iterator it; 21 ChromeProcessList::const_iterator it;
22 for (it = process_pids.begin(); it != process_pids.end(); ++it) { 22 for (it = process_pids.begin(); it != process_pids.end(); ++it) {
23 base::ProcessHandle handle; 23 base::ProcessHandle handle;
24 if (!base::OpenPrivilegedProcessHandle(*it, &handle)) { 24 if (!base::OpenPrivilegedProcessHandle(*it, &handle)) {
25 // Ignore processes for which we can't open the handle. We don't 25 // Ignore processes for which we can't open the handle. We don't
26 // guarantee that all processes will terminate, only try to do so. 26 // guarantee that all processes will terminate, only try to do so.
27 continue; 27 continue;
28 } 28 }
29 29
30 base::KillProcess(handle, ResultCodes::TASKMAN_KILL, true); 30 base::KillProcess(handle, ResultCodes::KILLED, true);
31 base::CloseProcessHandle(handle); 31 base::CloseProcessHandle(handle);
32 } 32 }
33 } 33 }
34 34
35 class ChildProcessFilter : public base::ProcessFilter { 35 class ChildProcessFilter : public base::ProcessFilter {
36 public: 36 public:
37 explicit ChildProcessFilter(base::ProcessId parent_pid) 37 explicit ChildProcessFilter(base::ProcessId parent_pid)
38 : parent_pids_(&parent_pid, (&parent_pid) + 1) {} 38 : parent_pids_(&parent_pid, (&parent_pid) + 1) {}
39 39
40 explicit ChildProcessFilter(std::vector<base::ProcessId> parent_pids) 40 explicit ChildProcessFilter(std::vector<base::ProcessId> parent_pids)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 base::ProcessHandle process) { 110 base::ProcessHandle process) {
111 #if !defined(OS_MACOSX) 111 #if !defined(OS_MACOSX)
112 process_metrics_.reset( 112 process_metrics_.reset(
113 base::ProcessMetrics::CreateProcessMetrics(process)); 113 base::ProcessMetrics::CreateProcessMetrics(process));
114 #else 114 #else
115 process_metrics_.reset( 115 process_metrics_.reset(
116 base::ProcessMetrics::CreateProcessMetrics(process, NULL)); 116 base::ProcessMetrics::CreateProcessMetrics(process, NULL));
117 #endif 117 #endif
118 process_handle_ = process; 118 process_handle_ = process;
119 } 119 }
120
OLDNEW
« no previous file with comments | « chrome/common/result_codes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698