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

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: 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..bd160416d8ff4a80a1d7a895168986b1ff29deea 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,23 @@ 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) {
+ // If a |metro_viewer_process_host_| exists, it should always be connected
+ // at this point.
+ NOTREACHED();
robertshield 2013/05/10 16:51:48 what if this gets called twice before OnMetroViewe
gab 2013/05/13 17:46:16 OnMetroViewerProcessTerminated() is called synchro
+ 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.
+ base::KillProcessById(viewer_id, 0, true);
+ }
+}
+
void BrowserProcessImpl::PerformInitForWindowsAura(
const CommandLine& command_line) {
if (command_line.HasSwitch(switches::kViewerConnection) &&

Powered by Google App Engine
This is Rietveld 408576698