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

Unified Diff: chrome/browser/chromeos/login/app_launch_controller.cc

Issue 127183002: kiosk: Fix StartupAppLauncher::LaunchApp crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: per discussion Created 6 years, 11 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 | « chrome/browser/chromeos/login/app_launch_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/app_launch_controller.cc
diff --git a/chrome/browser/chromeos/login/app_launch_controller.cc b/chrome/browser/chromeos/login/app_launch_controller.cc
index cf415c0dc9dfad35818dbb420ca48b808354c1cf..e93d3a7188dabbc221684dcca49954a12157ebfd 100644
--- a/chrome/browser/chromeos/login/app_launch_controller.cc
+++ b/chrome/browser/chromeos/login/app_launch_controller.cc
@@ -26,7 +26,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
-#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "net/base/network_change_notifier.h"
@@ -219,6 +218,7 @@ void AppLaunchController::OnProfileLoadFailed(
void AppLaunchController::CleanUp() {
kiosk_profile_loader_.reset();
startup_app_launcher_.reset();
+ splash_wait_timer_.Stop();
if (host_)
host_->Finalize();
@@ -326,6 +326,9 @@ void AppLaunchController::OnReadyToLaunch() {
if (!webui_visible_)
return;
+ if (splash_wait_timer_.IsRunning())
+ return;
+
const int64 time_taken_ms = (base::TimeTicks::Now() -
base::TimeTicks::FromInternalValue(launch_splash_start_time_)).
InMilliseconds();
@@ -333,12 +336,12 @@ void AppLaunchController::OnReadyToLaunch() {
// Enforce that we show app install splash screen for some minimum amount
// of time.
if (!skip_splash_wait_ && time_taken_ms < kAppInstallSplashScreenMinTimeMS) {
- content::BrowserThread::PostDelayedTask(
- content::BrowserThread::UI,
+ splash_wait_timer_.Start(
FROM_HERE,
- base::Bind(&AppLaunchController::OnReadyToLaunch, AsWeakPtr()),
base::TimeDelta::FromMilliseconds(
- kAppInstallSplashScreenMinTimeMS - time_taken_ms));
+ kAppInstallSplashScreenMinTimeMS - time_taken_ms),
+ this,
+ &AppLaunchController::OnReadyToLaunch);
return;
}
@@ -355,7 +358,8 @@ void AppLaunchController::OnLaunchSucceeded() {
}
void AppLaunchController::OnLaunchFailed(KioskAppLaunchError::Error error) {
- LOG(ERROR) << "Kiosk launch failed. Will now shut down.";
+ LOG(ERROR) << "Kiosk launch failed. Will now shut down."
+ << ", error=" << error;
DCHECK_NE(KioskAppLaunchError::NONE, error);
// Saves the error and ends the session to go back to login screen.
« no previous file with comments | « chrome/browser/chromeos/login/app_launch_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698