New issue
Advanced search Search tips

Issue 710848 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug



Sign in to add a comment

Allow saving session in new CSChromium

Project Member Reported by sdefresne@chromium.org, Apr 12 2017

Issue description

CSChromium always starts with 7 empty tabs. Fix this by:
1. saving session when changes occurs
  - tabs are opened/closed
  - active tab changes
  - navigation occurs
2. restoring session on startup

Note that new architecture supports having multiple Browser per ChromeBrowserState, so the serialisation mechanism needs to supports saving multiple SessionWindowIOS (which correspond to the state of a WebStateList).

In addition, the restoration needs to fix the list of invalid certificates exceptions from the serialised session and to properly restore the WKWebView scroll position.
 
As the new architecture does not depend/use TabModel nor Tab, this code needs to be moved to WebStateList/Browser.
Components: UI>Browser
Project Member

Comment 3 by bugdroid1@chromium.org, Apr 19 2017

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

commit dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5
Author: sdefresne <sdefresne@chromium.org>
Date: Wed Apr 19 15:49:02 2017

[ios] Allow having multiple session windows in a session.

With the new architecture, there can be multiple WebStateList per
ChromeBrowserState (due to BrowserList owning multiple Browsers).

Introduce SessionIOS that store the information about a session
(e.g. a BrowserList) with a list of SessionWindowIOS objects and
change SessionServiceIOS to use SessionIOS in its API.

Add support for loading legacy saved session with a single root
object of type SessionWindowIOS by creating a SessionIOS on the
fly.

BUG= 710848 

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

[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/crash_report/crash_restore_helper.mm
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/sessions/BUILD.gn
[add] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/sessions/session_ios.h
[add] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/sessions/session_ios.mm
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/sessions/session_service_ios.h
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/sessions/session_service_ios.mm
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/sessions/session_service_ios_unittest.mm
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/sessions/session_window_ios.h
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/sessions/test_session_service.mm
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/tabs/tab_model.mm
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/tabs/tab_model_unittest.mm
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/test/perf_test_with_bvc_ios.mm
[modify] https://crrev.com/dcc6c6ec0d3999a98c28a0124ef6ca232ef907a5/ios/chrome/browser/ui/main/browser_view_wrangler.mm

Components: -UI>Browser UI>Browser>Sessions
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 20 2017

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

commit 68f546a315406dfa72656a6bd2a6d73ff4269ec2
Author: sdefresne <sdefresne@chromium.org>
Date: Thu Apr 20 10:54:03 2017

[ios] Change WebStateList serialization method to use SessionWindowIOS.

In order to properly save and restore the application state in the new
architecture, (partially) move the implementation outside of TabModel
(which is not used in the new architecture).

BUG= 710848 

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

[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/browsing_data/BUILD.gn
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/crash_report/BUILD.gn
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/sessions/BUILD.gn
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/sessions/NSCoder+Compatibility.mm
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/sessions/session_util.mm
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/tabs/BUILD.gn
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/tabs/tab_model.mm
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/test/BUILD.gn
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/ui/main/BUILD.gn
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/web_state_list/BUILD.gn
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/web_state_list/web_state_list_serialization.h
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/web_state_list/web_state_list_serialization.mm
[modify] https://crrev.com/68f546a315406dfa72656a6bd2a6d73ff4269ec2/ios/chrome/browser/web_state_list/web_state_list_serialization_unittest.mm

Project Member

Comment 6 by bugdroid1@chromium.org, Apr 24 2017

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

commit c8f7b8538f35a1d800bcd9e70ec1bd74a863e916
Author: sdefresne <sdefresne@chromium.org>
Date: Mon Apr 24 11:44:19 2017

[ios] Reduce access to private //ios/web API.

Call CRWWebController -recordStateInHistory when building the
serialised session storage CRWSessionStorage from WebStateImpl
to ensure the scroll position is correctly saved.

Remove direct call CRWWebController -recordStateInHistory from
//ios/chrome/browser as it is a private //ios/web API.

BUG=620465,620480, 710848 

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

[modify] https://crrev.com/c8f7b8538f35a1d800bcd9e70ec1bd74a863e916/ios/chrome/browser/tabs/tab.h
[modify] https://crrev.com/c8f7b8538f35a1d800bcd9e70ec1bd74a863e916/ios/chrome/browser/tabs/tab.mm
[modify] https://crrev.com/c8f7b8538f35a1d800bcd9e70ec1bd74a863e916/ios/chrome/browser/tabs/tab_model.mm
[modify] https://crrev.com/c8f7b8538f35a1d800bcd9e70ec1bd74a863e916/ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm
[modify] https://crrev.com/c8f7b8538f35a1d800bcd9e70ec1bd74a863e916/ios/chrome/browser/ui/browser_view_controller.mm
[modify] https://crrev.com/c8f7b8538f35a1d800bcd9e70ec1bd74a863e916/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm
[modify] https://crrev.com/c8f7b8538f35a1d800bcd9e70ec1bd74a863e916/ios/web/web_state/ui/crw_web_controller.mm
[modify] https://crrev.com/c8f7b8538f35a1d800bcd9e70ec1bd74a863e916/ios/web/web_state/web_state_impl.mm

Project Member

Comment 8 by bugdroid1@chromium.org, May 15 2017

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

commit b95d16dd12e99c5f1c3ea2e7316fef8f50066f98
Author: sdefresne <sdefresne@chromium.org>
Date: Mon May 15 16:51:22 2017

[ios] Add session saving support to clean skeleton.

BrowserListSessionService is a KeyedService that tracks BrowserList
and automatically save the session when the current WebState of any
WebStateList changes or when a navigation item is committed in an
active WebState.

Use BrowserListSessionService to load the session during the
initialisation of the RootCoordinator.

BUG= 710848 

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

[modify] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/chrome/browser/browser_state/BUILD.gn
[modify] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm
[modify] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/clean/chrome/app/steps/root_coordinator+application_step.mm
[modify] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/shared/chrome/browser/ui/browser_list/BUILD.gn
[add] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/shared/chrome/browser/ui/browser_list/DEPS
[add] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/shared/chrome/browser/ui/browser_list/browser_list_session_service.h
[add] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/shared/chrome/browser/ui/browser_list/browser_list_session_service_factory.h
[add] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/shared/chrome/browser/ui/browser_list/browser_list_session_service_factory.mm
[add] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/shared/chrome/browser/ui/browser_list/browser_list_session_service_impl.h
[add] https://crrev.com/b95d16dd12e99c5f1c3ea2e7316fef8f50066f98/ios/shared/chrome/browser/ui/browser_list/browser_list_session_service_impl.mm

Status: Fixed (was: Started)
Project Member

Comment 10 by bugdroid1@chromium.org, May 24 2017

Labels: merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da2e896aee0b0b634c064cb3ad2ed4d71a38349e

commit da2e896aee0b0b634c064cb3ad2ed4d71a38349e
Author: kkhorimoto <kkhorimoto@chromium.org>
Date: Wed May 24 21:02:53 2017

[ios] Change WebStateList serialization method to use SessionWindowIOS.

In order to properly save and restore the application state in the new
architecture, (partially) move the implementation outside of TabModel
(which is not used in the new architecture).

BUG= 710848 ,  723665 
NOTRY=true
NOPRESUBMIT=true
TBR=sdefresne@chromium.org

Review-Url: https://codereview.chromium.org/2808773004
Cr-Original-Commit-Position: refs/heads/master@{#465969}
Review-Url: https://codereview.chromium.org/2897333002
Cr-Commit-Position: refs/branch-heads/3071@{#686}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/browsing_data/BUILD.gn
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/crash_report/BUILD.gn
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/sessions/BUILD.gn
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/sessions/NSCoder+Compatibility.mm
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/sessions/session_util.mm
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/tabs/BUILD.gn
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/tabs/tab_model.mm
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/test/BUILD.gn
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/ui/main/BUILD.gn
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/web_state_list/BUILD.gn
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/web_state_list/web_state_list_serialization.h
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/web_state_list/web_state_list_serialization.mm
[modify] https://crrev.com/da2e896aee0b0b634c064cb3ad2ed4d71a38349e/ios/chrome/browser/web_state_list/web_state_list_serialization_unittest.mm

Sign in to add a comment