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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 740813004: Use StopChildProcess instead of base::KillProcess to kill a renderer process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typos Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 7ab54bf0cab318432f04509f45773d236b9ffafb..6f683126f6a7c114dfafeddb3577f56a3f04a7b3 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1475,12 +1475,12 @@ void WebContentsImpl::CreateNewWindow(
// this WebContentsImpl instance. If any other process sends the request,
// it is invalid and the process must be terminated.
if (GetRenderProcessHost()->GetID() != render_process_id) {
- base::ProcessHandle process_handle =
- RenderProcessHost::FromID(render_process_id)->GetHandle();
+ RenderProcessHost* rph = RenderProcessHost::FromID(render_process_id);
+ base::ProcessHandle process_handle = rph->GetHandle();
if (process_handle != base::kNullProcessHandle) {
RecordAction(
base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWindow"));
- base::KillProcess(process_handle, RESULT_CODE_KILLED, false);
+ rph->FastShutdown(RESULT_CODE_KILLED, false);
}
return;
}
@@ -1609,12 +1609,12 @@ void WebContentsImpl::CreateNewWidget(int render_process_id,
// this WebContentsImpl instance. If any other process sends the request,
// it is invalid and the process must be terminated.
if (process->GetID() != render_process_id) {
- base::ProcessHandle process_handle =
- RenderProcessHost::FromID(render_process_id)->GetHandle();
+ RenderProcessHost* rph = RenderProcessHost::FromID(render_process_id);
+ base::ProcessHandle process_handle = rph->GetHandle();
if (process_handle != base::kNullProcessHandle) {
RecordAction(
base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget"));
- base::KillProcess(process_handle, RESULT_CODE_KILLED, false);
+ rph->FastShutdown(RESULT_CODE_KILLED, false);
}
return;
}

Powered by Google App Engine
This is Rietveld 408576698