| 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);
|
| + }
|
| }
|
|
|