summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorrvargas <rvargas@chromium.org>2015-03-31 21:10:12 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-01 04:11:15 +0000
commitf8d789c4558c7575f4d388d44730d18fdf15772c (patch)
tree54807f725d613c10d0026a98cedb89189bef1a06 /chrome
parentd65edb7b2d228497056e18100c882f7cf7d59c36 (diff)
downloadchromium_src-f8d789c4558c7575f4d388d44730d18fdf15772c.zip
chromium_src-f8d789c4558c7575f4d388d44730d18fdf15772c.tar.gz
chromium_src-f8d789c4558c7575f4d388d44730d18fdf15772c.tar.bz2
Remove uses of KillProcess.
BUG=417532 Review URL: https://codereview.chromium.org/1035323002 Cr-Commit-Position: refs/heads/master@{#323179}
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/apps/guest_view/web_view_browsertest.cc7
-rw-r--r--chrome/browser/chrome_plugin_browsertest.cc6
-rw-r--r--chrome/browser/extensions/api/processes/processes_api.cc5
-rw-r--r--chrome/browser/task_manager/task_manager.cc11
-rw-r--r--chrome/browser/ui/cocoa/hung_renderer_controller.mm9
-rw-r--r--chrome/browser/ui/hung_plugin_tab_helper.cc4
6 files changed, 27 insertions, 15 deletions
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc
index 079deed..14b2f9f 100644
--- a/chrome/browser/apps/guest_view/web_view_browsertest.cc
+++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/path_service.h"
+#include "base/process/process.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
@@ -2664,9 +2665,9 @@ IN_PROC_BROWSER_TEST_F(
rules_registry_id, "ui").get());
// Kill the embedder's render process, so the webview will go as well.
- content::RenderProcessHost* host =
- embedder_web_contents->GetRenderProcessHost();
- base::KillProcess(host->GetHandle(), 0, false);
+ base::Process process = base::Process::DeprecatedGetProcessFromHandle(
+ embedder_web_contents->GetRenderProcessHost()->GetHandle());
+ process.Terminate(0, false);
observer->WaitForEmbedderRenderProcessTerminate();
EXPECT_FALSE(registry_service->GetRulesRegistry(
diff --git a/chrome/browser/chrome_plugin_browsertest.cc b/chrome/browser/chrome_plugin_browsertest.cc
index 795cfda..7504520 100644
--- a/chrome/browser/chrome_plugin_browsertest.cc
+++ b/chrome/browser/chrome_plugin_browsertest.cc
@@ -11,7 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/prefs/pref_service.h"
-#include "base/process/kill.h"
+#include "base/process/process.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/browser/profiles/profile.h"
@@ -171,7 +171,9 @@ class ChromePluginTest : public InProcessBrowserTest {
iter.GetData().process_type != content::PROCESS_TYPE_PPAPI_PLUGIN) {
continue;
}
- base::KillProcess(iter.GetData().handle, 0, true);
+ base::Process process = base::Process::DeprecatedGetProcessFromHandle(
+ iter.GetData().handle);
+ process.Terminate(0, true);
found = true;
}
ASSERT_TRUE(found) << "Didn't find Flash process!";
diff --git a/chrome/browser/extensions/api/processes/processes_api.cc b/chrome/browser/extensions/api/processes/processes_api.cc
index 56a7cb7..e2cc202 100644
--- a/chrome/browser/extensions/api/processes/processes_api.cc
+++ b/chrome/browser/extensions/api/processes/processes_api.cc
@@ -640,8 +640,9 @@ void TerminateFunction::TerminateProcess() {
if (model->IsResourceFirstInGroup(i)) {
if (process_id_ == model->GetUniqueChildProcessId(i)) {
found = true;
- killed = base::KillProcess(model->GetProcess(i),
- content::RESULT_CODE_KILLED, true);
+ base::Process process =
+ base::Process::DeprecatedGetProcessFromHandle(model->GetProcess(i));
+ killed = process.Terminate(content::RESULT_CODE_KILLED, true);
UMA_HISTOGRAM_COUNTS("ChildProcess.KilledByExtensionAPI", 1);
break;
}
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
index 0bf4708..c9df8ec 100644
--- a/chrome/browser/task_manager/task_manager.cc
+++ b/chrome/browser/task_manager/task_manager.cc
@@ -1549,10 +1549,13 @@ bool TaskManager::IsBrowserProcess(int index) const {
}
void TaskManager::KillProcess(int index) {
- base::ProcessHandle process = model_->GetProcess(index);
- DCHECK(process);
- if (process != base::GetCurrentProcessHandle())
- base::KillProcess(process, content::RESULT_CODE_KILLED, false);
+ base::ProcessHandle process_handle = model_->GetProcess(index);
+ DCHECK(process_handle);
+ if (process_handle != base::GetCurrentProcessHandle()) {
+ base::Process process =
+ base::Process::DeprecatedGetProcessFromHandle(process_handle);
+ process.Terminate(content::RESULT_CODE_KILLED, false);
+ }
}
void TaskManager::ActivateProcess(int index) {
diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.mm b/chrome/browser/ui/cocoa/hung_renderer_controller.mm
index d37254e..a72eeca 100644
--- a/chrome/browser/ui/cocoa/hung_renderer_controller.mm
+++ b/chrome/browser/ui/cocoa/hung_renderer_controller.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "base/mac/bundle_locations.h"
+#include "base/process/process.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
#import "chrome/browser/ui/cocoa/multi_key_equivalent_button.h"
@@ -120,9 +121,11 @@ class HungRendererWebContentsObserverBridge
}
- (IBAction)kill:(id)sender {
- if (hungContents_)
- base::KillProcess(hungContents_->GetRenderProcessHost()->GetHandle(),
- content::RESULT_CODE_HUNG, false);
+ if (hungContents_) {
+ base::Process process = base::Process::DeprecatedGetProcessFromHandle(
+ hungContents_->GetRenderProcessHost()->GetHandle());
+ process.Terminate(content::RESULT_CODE_HUNG, false);
+ }
// Cannot call performClose:, because the close button is disabled.
[self close];
}
diff --git a/chrome/browser/ui/hung_plugin_tab_helper.cc b/chrome/browser/ui/hung_plugin_tab_helper.cc
index bb9a21c..afcd1e8 100644
--- a/chrome/browser/ui/hung_plugin_tab_helper.cc
+++ b/chrome/browser/ui/hung_plugin_tab_helper.cc
@@ -112,7 +112,9 @@ void KillPluginOnIOThread(int child_id) {
base::Bind(&DumpAndTerminatePluginInBlockingPool,
base::Owned(new base::win::ScopedHandle(handle))));
#else
- base::KillProcess(data.handle, content::RESULT_CODE_HUNG, false);
+ base::Process process =
+ base::Process::DeprecatedGetProcessFromHandle(data.handle);
+ process.Terminate(content::RESULT_CODE_HUNG, false);
#endif
break;
}