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

Unified Diff: chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc

Issue 1128823009: Added check in OnChannelError to see if metro/ash desktop is created. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc
diff --git a/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc b/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc
index d046ac36408cf4bdb7c91727309f13ce5fe53fa6..2b5fcb9f5db1cc43b95ff7a901a683bffc06be3a 100644
--- a/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc
+++ b/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc
@@ -87,21 +87,29 @@ void ChromeMetroViewerProcessHost::OnChannelError() {
// connected.
::SetEnvironmentVariableA(env_vars::kMetroConnected, NULL);
- aura::RemoteWindowTreeHostWin::Instance()->Disconnected();
- chrome::DecrementKeepAliveCount();
-
- // If browser is trying to quit, we shouldn't reenter the process.
- // TODO(shrikant): In general there seem to be issues with how AttemptExit
- // reentry works. In future release please clean up related code.
- if (!browser_shutdown::IsTryingToQuit()) {
- CloseOpenAshBrowsers();
- chrome::CloseAsh();
+ // It seems possible that channel is connected, but ASH desktop is not yet
+ // created (instance is still NULL) and we receive channel error.
+ if (aura::RemoteWindowTreeHostWin::Instance()) {
+ aura::RemoteWindowTreeHostWin::Instance()->Disconnected();
+
+ chrome::DecrementKeepAliveCount();
+
+ // If browser is trying to quit, we shouldn't reenter the process.
+ // TODO(shrikant): In general there seem to be issues with how AttemptExit
+ // reentry works. In future release please clean up related code.
+ if (!browser_shutdown::IsTryingToQuit()) {
+ CloseOpenAshBrowsers();
+ chrome::CloseAsh();
+ }
+ // Tell the rest of Chrome about it.
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_ASH_SESSION_ENDED,
+ content::NotificationService::AllSources(),
+ content::NotificationService::NoDetails());
+ return;
}
- // Tell the rest of Chrome about it.
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_ASH_SESSION_ENDED,
- content::NotificationService::AllSources(),
- content::NotificationService::NoDetails());
+
+ chrome::DecrementKeepAliveCount();
// This will delete the MetroViewerProcessHost object. Don't access member
// variables/functions after this call.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698