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

Unified Diff: chrome/browser/browser_process_platform_part_winaura.cc

Issue 14576015: In WinAura, also kill the Metro viewer process in AttemptExit(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on top of https://codereview.chromium.org/14576015/ Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browser_process_platform_part_winaura.cc
diff --git a/chrome/browser/browser_process_platform_part_winaura.cc b/chrome/browser/browser_process_platform_part_winaura.cc
index d1ca40c958a1385680946824c042e7999272b6d6..abee0994c6498ca735b446303064fbd7508f2fad 100644
--- a/chrome/browser/browser_process_platform_part_winaura.cc
+++ b/chrome/browser/browser_process_platform_part_winaura.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/browser_process_platform_part_winaura.h"
#include "base/command_line.h"
+#include "base/logging.h"
+#include "base/process_util.h"
#include "chrome/browser/metro_viewer/metro_viewer_process_host_win.h"
#include "chrome/common/chrome_switches.h"
@@ -29,5 +31,19 @@ void BrowserProcessPlatformPart::StartTearDown() {
}
void BrowserProcessPlatformPart::OnMetroViewerProcessTerminated() {
- metro_viewer_process_host_.reset(NULL);
+ metro_viewer_process_host_.reset();
+}
+
+void BrowserProcessPlatformPart::TerminateMetroViewerProcess() {
+ if (metro_viewer_process_host_) {
+ base::ProcessId viewer_id =
+ metro_viewer_process_host_->GetViewerProcessId();
+ if (viewer_id == base::kNullProcessId)
+ return;
+ // The viewer doesn't hold any state so it is fine to kill it before it
+ // cleanly exits. This will trigger MetroViewerProcessHost::OnChannelError()
+ // which will cleanup references to g_browser_process.
+ bool success = base::KillProcessById(viewer_id, 0, true);
+ DCHECK(success);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698