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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include "chrome/browser/browser_process_impl.h" 4 #include "chrome/browser/browser_process_impl.h"
5 5
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "chrome/common/chrome_switches.h"
8 7
9 #if defined(USE_AURA) 8 #if defined(USE_AURA)
9 #include "base/logging.h"
10 #include "base/process_util.h"
10 #include "chrome/browser/metro_viewer/metro_viewer_process_host_win.h" 11 #include "chrome/browser/metro_viewer/metro_viewer_process_host_win.h"
12 #include "chrome/common/chrome_switches.h"
11 #endif 13 #endif
12 14
13 void BrowserProcessImpl::PlatformSpecificCommandLineProcessing( 15 void BrowserProcessImpl::PlatformSpecificCommandLineProcessing(
14 const CommandLine& command_line) { 16 const CommandLine& command_line) {
15 #if defined(USE_AURA) 17 #if defined(USE_AURA)
16 PerformInitForWindowsAura(command_line); 18 PerformInitForWindowsAura(command_line);
17 #endif 19 #endif
18 } 20 }
19 21
20 #if defined(USE_AURA) 22 #if defined(USE_AURA)
21 void BrowserProcessImpl::OnMetroViewerProcessTerminated() { 23 void BrowserProcessImpl::OnMetroViewerProcessTerminated() {
22 metro_viewer_process_host_.reset(NULL); 24 metro_viewer_process_host_.reset(NULL);
23 } 25 }
24 26
27 void BrowserProcessImpl::TerminateMetroViewerProcess() {
28 if (metro_viewer_process_host_) {
29 base::ProcessId viewer_id =
30 metro_viewer_process_host_->GetViewerProcessId();
31 if (viewer_id == base::kNullProcessId) {
32 // If a |metro_viewer_process_host_| exists, it should always be connected
33 // at this point.
34 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
35 return;
36 }
37 // The viewer doesn't hold any state so it is fine to kill it before it
38 // cleanly exits. This will trigger MetroViewerProcessHost::OnChannelError()
39 // which will cleanup references to g_browser_process.
40 base::KillProcessById(viewer_id, 0, true);
41 }
42 }
43
25 void BrowserProcessImpl::PerformInitForWindowsAura( 44 void BrowserProcessImpl::PerformInitForWindowsAura(
26 const CommandLine& command_line) { 45 const CommandLine& command_line) {
27 if (command_line.HasSwitch(switches::kViewerConnection) && 46 if (command_line.HasSwitch(switches::kViewerConnection) &&
28 !metro_viewer_process_host_.get()) { 47 !metro_viewer_process_host_.get()) {
29 // Tell the metro viewer process host to connect to the given IPC channel. 48 // Tell the metro viewer process host to connect to the given IPC channel.
30 metro_viewer_process_host_.reset( 49 metro_viewer_process_host_.reset(
31 new MetroViewerProcessHost( 50 new MetroViewerProcessHost(
32 command_line.GetSwitchValueASCII(switches::kViewerConnection))); 51 command_line.GetSwitchValueASCII(switches::kViewerConnection)));
33 } 52 }
34 } 53 }
35 #endif 54 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698