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

Unified Diff: chrome/browser/browser_process_impl_win.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: removed NOTREACHED() as discussed 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_impl_win.cc
diff --git a/chrome/browser/browser_process_impl_win.cc b/chrome/browser/browser_process_impl_win.cc
index 9d013fdbb23ed98e0356988af2a123a98e4aba3c..2e2c0435163c7c3bf70a5866a13e29729d142aef 100644
--- a/chrome/browser/browser_process_impl_win.cc
+++ b/chrome/browser/browser_process_impl_win.cc
@@ -4,10 +4,12 @@
#include "chrome/browser/browser_process_impl.h"
#include "base/command_line.h"
-#include "chrome/common/chrome_switches.h"
#if defined(USE_AURA)
+#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"
#endif
void BrowserProcessImpl::PlatformSpecificCommandLineProcessing(
@@ -22,6 +24,20 @@ void BrowserProcessImpl::OnMetroViewerProcessTerminated() {
metro_viewer_process_host_.reset(NULL);
}
+void BrowserProcessImpl::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);
+ }
+}
+
void BrowserProcessImpl::PerformInitForWindowsAura(
const CommandLine& command_line) {
if (command_line.HasSwitch(switches::kViewerConnection) &&

Powered by Google App Engine
This is Rietveld 408576698