summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metro_viewer
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 22:53:56 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 22:53:56 +0000
commit88bb912cafbfa299fea3c54ebd9f5c7e789ae122 (patch)
tree1024251d976e8d3251dd33bbfb7df1540ecb4b9c /chrome/browser/metro_viewer
parent8a474e1987e1b8bb7c826a0473ee4320f38329eb (diff)
downloadchromium_src-88bb912cafbfa299fea3c54ebd9f5c7e789ae122.zip
chromium_src-88bb912cafbfa299fea3c54ebd9f5c7e789ae122.tar.gz
chromium_src-88bb912cafbfa299fea3c54ebd9f5c7e789ae122.tar.bz2
Launching ASH on Windows 8 should activate an existing instance if one exits.
The current behavior when there is an existing instance of ASH is that the launch fails taking down the existing instance of ASH. This is because metro app launches go through the delegate execute handler which first tries to launch the metro viewer process (browser). If we have an existing browser process which has an active MetroViewerProcessHost instance, we delete it first and recreate it. This takes down the existing ASH instance and attempts to launch the new one fail, because of a race condition in the metro startup code. Fix is to create a new instance of the MetroViewerProcessHost instance only if one does not exist in the BrowserProcessImpl::PerformInitForWindowsAura function which is invoked when a brower process processes a launch command line. We reset the MetroViewerProcessHost instance when we receive an OnChannelError notification in the MetroViewerProcessHost class. It in turn invokes the virtual function OnMetroViewerProcessTerminated added on the BrowserProcess interface with a windows aura specific implementation in the browser_process_impl_win.cc file. BUG=234429 R=cpu Review URL: https://codereview.chromium.org/13973023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196254 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metro_viewer')
-rw-r--r--chrome/browser/metro_viewer/metro_viewer_process_host_win.cc3
-rw-r--r--chrome/browser/metro_viewer/metro_viewer_process_host_win.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc b/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc
index 3ed753a..806d29c 100644
--- a/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc
+++ b/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc
@@ -77,6 +77,9 @@ void MetroViewerProcessHost::OnChannelError() {
g_browser_process->ReleaseModule();
CloseOpenAshBrowsers();
chrome::CloseAsh();
+ // This will delete the MetroViewerProcessHost object. Don't access member
+ // variables/functions after this call.
+ g_browser_process->OnMetroViewerProcessTerminated();
}
void MetroViewerProcessHost::OnSetTargetSurface(
diff --git a/chrome/browser/metro_viewer/metro_viewer_process_host_win.h b/chrome/browser/metro_viewer/metro_viewer_process_host_win.h
index d38531d..1527d52 100644
--- a/chrome/browser/metro_viewer/metro_viewer_process_host_win.h
+++ b/chrome/browser/metro_viewer/metro_viewer_process_host_win.h
@@ -24,6 +24,7 @@ class MetroViewerProcessHost : public IPC::Listener,
explicit MetroViewerProcessHost(const std::string& ipc_channel_name);
virtual ~MetroViewerProcessHost();
+ private:
// IPC::Sender implementation:
virtual bool Send(IPC::Message* msg) OVERRIDE;
@@ -31,7 +32,6 @@ class MetroViewerProcessHost : public IPC::Listener,
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void OnChannelError() OVERRIDE;
- private:
void OnSetTargetSurface(gfx::NativeViewId target_surface);
scoped_ptr<IPC::ChannelProxy> channel_;