New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 677340 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Information about whether a kiosk app was autolaunched gets lost after crash restore

Project Member Reported by tbarzic@chromium.org, Dec 28 2016

Issue description

Information about whether a kiosk app was auto-launched is kept in memory, which means that it gets reset in event of a browser crash.

When user session is restarted after the crash, the auto launched app id (KioskAppManager::currently_auto_launched_with_zero_delay_app_) does not get properly set (as there is no way to determine whether kiosk session was auto launched at that point) - as the result, the session is not considered auto launched by code whose behavior depends on said flag.

For example, in restored session following is broken:
- chrome.fileSystem.requestFileSystem asks user confirmation for giving access to requested file system (as it should for non-auto-launched kiosk sessions)
- peripheral chrome.bluetoothLowEnergy start failing with permissions error.


 
I wonder if it would be reasonable to skip crash restore for kiosks, especially for auto-launched sessions - starting Chrome session from scratch should end up auto-launching the app again.
Right. Auto launch state is not preserved. On crash-n-restart, the app is launched here:
https://cs.chromium.org/chromium/src/chrome/browser/ui/startup/startup_browser_creator.cc?rcl=0&l=640

And we don't have whether this is an auto launch info there.

One possible way to preserve the info is to create a command line switch. Session manager would keep the switch for us. We figure out which app to relaunch via "--app-id". And probably can add a "--auto-launched" to keep the info across restarts.
Yeah, one way to fix this would be to let session manager know that current session is autolaunched, and have it append --auto-launched flag when Chrome is restarted (e.g. using SetFlagsForUser, though this could get a little tricky when kiosk session flags are non-empty, e.g. due to policy flags).

Another possibility would be to add a flag 'kiosk.restoreSessionAsAutoLaunched' (or something along these lines) to local_state, and set it appropriately when an app is launched. Then when restoring session from crash, autolaunched state could be initialized base on that flag's value.
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb

commit 663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb
Author: tbarzic <tbarzic@chromium.org>
Date: Wed Jan 25 23:51:01 2017

Restore auto-launched state on kiosk restart within session

When kiosk app is restarted within a kiosk session - e.g. due to crash,
app's auto-launched state has to be preserved. Previously auto-launched
state was kept only in memory - if kiosk was restarted, the information
would get lost.
This CL is attempt to fix the problem by preserving auto-launched state
by setting a user session scoped flag that indicates that the kiosk app
is auto-launched (newly introduced app-auto-launched). The flag will be
scoped to current used session, and will be passed to Chrome in a case
Chrome restarts withing the user session. On restart, the flag can be
used to deduce whether the kiosk app should be considered auto-launched
or not.

Note that when setting the auto-launched flag, it's important to
consider current set of policy defined flags - they should be
preserved when auto-launched flag is added to set of user flags.

BUG= 677340 

Review-Url: https://codereview.chromium.org/2639033002
Cr-Commit-Position: refs/heads/master@{#446166}

[modify] https://crrev.com/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
[modify] https://crrev.com/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
[delete] https://crrev.com/0d3069a5ad51f4d337927f5a1ed4e0945488d7c1/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc
[add] https://crrev.com/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb/chrome/browser/chromeos/login/auto_launched_kiosk_browsertest.cc
[modify] https://crrev.com/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
[modify] https://crrev.com/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb/chrome/test/BUILD.gn
[modify] https://crrev.com/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb/chromeos/chromeos_switches.cc
[modify] https://crrev.com/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb/chromeos/chromeos_switches.h

Project Member

Comment 5 by bugdroid1@chromium.org, Jan 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/92ebeda78b7d6e27e7afa0ef44c82140ce682441

commit 92ebeda78b7d6e27e7afa0ef44c82140ce682441
Author: kjellander <kjellander@chromium.org>
Date: Thu Jan 26 05:46:42 2017

Revert of Restore auto-launched state on kiosk restart within session (patchset #6 id:100001 of https://codereview.chromium.org/2639033002/ )

Reason for revert:
browser_tests test AutoLaunchedKioskTest.PRE_CrashRestore starts timing out reliably with this CL, starting with https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/32762

Original issue's description:
> Restore auto-launched state on kiosk restart within session
>
> When kiosk app is restarted within a kiosk session - e.g. due to crash,
> app's auto-launched state has to be preserved. Previously auto-launched
> state was kept only in memory - if kiosk was restarted, the information
> would get lost.
> This CL is attempt to fix the problem by preserving auto-launched state
> by setting a user session scoped flag that indicates that the kiosk app
> is auto-launched (newly introduced app-auto-launched). The flag will be
> scoped to current used session, and will be passed to Chrome in a case
> Chrome restarts withing the user session. On restart, the flag can be
> used to deduce whether the kiosk app should be considered auto-launched
> or not.
>
> Note that when setting the auto-launched flag, it's important to
> consider current set of policy defined flags - they should be
> preserved when auto-launched flag is added to set of user flags.
>
> BUG= 677340 
>
> Review-Url: https://codereview.chromium.org/2639033002
> Cr-Commit-Position: refs/heads/master@{#446166}
> Committed: https://chromium.googlesource.com/chromium/src/+/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb

TBR=xiyuan@chromium.org,tbarzic@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 677340 

Review-Url: https://codereview.chromium.org/2658773002
Cr-Commit-Position: refs/heads/master@{#446240}

[modify] https://crrev.com/92ebeda78b7d6e27e7afa0ef44c82140ce682441/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
[modify] https://crrev.com/92ebeda78b7d6e27e7afa0ef44c82140ce682441/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
[add] https://crrev.com/92ebeda78b7d6e27e7afa0ef44c82140ce682441/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc
[delete] https://crrev.com/99fb0a7ab0aa355d6d2bd17ca0d6940b57ec44b4/chrome/browser/chromeos/login/auto_launched_kiosk_browsertest.cc
[modify] https://crrev.com/92ebeda78b7d6e27e7afa0ef44c82140ce682441/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/92ebeda78b7d6e27e7afa0ef44c82140ce682441/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
[modify] https://crrev.com/92ebeda78b7d6e27e7afa0ef44c82140ce682441/chrome/test/BUILD.gn
[modify] https://crrev.com/92ebeda78b7d6e27e7afa0ef44c82140ce682441/chromeos/chromeos_switches.cc
[modify] https://crrev.com/92ebeda78b7d6e27e7afa0ef44c82140ce682441/chromeos/chromeos_switches.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jan 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c6b3e0d3813eb1bc13bbaba9e5d19054890606c7

commit c6b3e0d3813eb1bc13bbaba9e5d19054890606c7
Author: tbarzic <tbarzic@chromium.org>
Date: Thu Jan 26 20:19:14 2017

Restore auto-launched state on kiosk restart within session

When kiosk app is restarted within a kiosk session - e.g. due to crash,
app's auto-launched state has to be preserved. Previously auto-launched
state was kept only in memory - if kiosk was restarted, the information
would get lost.
This CL is attempt to fix the problem by preserving auto-launched state
by setting a user session scoped flag that indicates that the kiosk app
is auto-launched (newly introduced app-auto-launched). The flag will be
scoped to current used session, and will be passed to Chrome in a case
Chrome restarts withing the user session. On restart, the flag can be
used to deduce whether the kiosk app should be considered auto-launched
or not.

Note that when setting the auto-launched flag, it's important to
consider current set of policy defined flags - they should be
preserved when auto-launched flag is added to set of user flags.

BUG= 677340 

Review-Url: https://codereview.chromium.org/2639033002
Cr-Original-Commit-Position: refs/heads/master@{#446166}
Committed: https://chromium.googlesource.com/chromium/src/+/663f7dfaa3b96b353ade5b9ce6b7616e51ba73bb
Review-Url: https://codereview.chromium.org/2639033002
Cr-Commit-Position: refs/heads/master@{#446427}

[modify] https://crrev.com/c6b3e0d3813eb1bc13bbaba9e5d19054890606c7/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
[modify] https://crrev.com/c6b3e0d3813eb1bc13bbaba9e5d19054890606c7/chrome/browser/chromeos/app_mode/kiosk_app_manager.h
[delete] https://crrev.com/a02187345a2ce4d5f929816aaddb1369a0afbed1/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc
[add] https://crrev.com/c6b3e0d3813eb1bc13bbaba9e5d19054890606c7/chrome/browser/chromeos/login/auto_launched_kiosk_browsertest.cc
[modify] https://crrev.com/c6b3e0d3813eb1bc13bbaba9e5d19054890606c7/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/c6b3e0d3813eb1bc13bbaba9e5d19054890606c7/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
[modify] https://crrev.com/c6b3e0d3813eb1bc13bbaba9e5d19054890606c7/chrome/test/BUILD.gn
[modify] https://crrev.com/c6b3e0d3813eb1bc13bbaba9e5d19054890606c7/chromeos/chromeos_switches.cc
[modify] https://crrev.com/c6b3e0d3813eb1bc13bbaba9e5d19054890606c7/chromeos/chromeos_switches.h

Labels: -M-57 M-58
Status: Fixed (was: Assigned)
Labels: -M-58 M-57 Merge-Request-57
Status: Assigned (was: Fixed)
requesting merge - note that this should fix KioskCrashRestoreTest breakage (https://bugs.chromium.org/p/chromium/issues/detail?id=689100) - the cl fix for this issue removes the test in question


Project Member

Comment 9 by sheriffbot@chromium.org, Feb 7 2017

Labels: -Merge-Request-57 Hotlist-Merge-Review Merge-Review-57
This bug requires manual review: Reverts referenced in bugdroid comments after merge request.
Please contact the milestone owner if you have questions.
Owners: amineer@(clank), cmasso@(bling), ketakid@(cros), govind@(desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Hotlist-Merge-Review -M-57 -Merge-Review-57 M-58
Status: Fixed (was: Assigned)
Cc: r...@chromium.org
Cc: -st...@chromium.org

Comment 13 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment