New issue
Advanced search Search tips

Issue 725539 link

Starred by 1 user

Issue metadata

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

Blocking:
issue 661986



Sign in to add a comment

Change SessionServiceIOS API to take a block instead of a SessionIOS

Project Member Reported by sdefresne@chromium.org, May 23 2017

Issue description

Currently code creates SessionIOS and request it to be serialised 2 seconds later. If any change to TabModel happens (tab closed/open or navigation complete), the object is dropped. This is wasted effort and instead the API should take a block to only create the SessionIOS just before sending the request on the IO thread.
 
Blocking: 661986
Cc: rohitrao@chromium.org
Components: UI>Browser>Sessions
Labels: -Type-Bug Type-Task
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 1 2017

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

commit 5fbebad59d0c1ababd1f05e01a4d5aae60bc3243
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Thu Jun 01 12:04:41 2017

[ios] Change SessionServiceIOS API to avoid useless work.

If multiple call to -saveSession:directory:immediately: are made
in quick succession, the SessionIOS objects are created to be
immediately destroyed when the scheduled save is cancelled.

Change the SessionServiceIOS API to instead take a block creating
the SessionIOS instance and invoke it on the main thread, before
requesting that the data be serialised to the disk (by sending a
task on IO thread).

BUG= 725539 

Change-Id: I82b42d2b46baf03a7280e60185973c635dc164a2
Reviewed-on: https://chromium-review.googlesource.com/513929
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476254}
[modify] https://crrev.com/5fbebad59d0c1ababd1f05e01a4d5aae60bc3243/ios/chrome/browser/sessions/session_service_ios.h
[modify] https://crrev.com/5fbebad59d0c1ababd1f05e01a4d5aae60bc3243/ios/chrome/browser/sessions/session_service_ios.mm
[modify] https://crrev.com/5fbebad59d0c1ababd1f05e01a4d5aae60bc3243/ios/chrome/browser/sessions/session_service_ios_unittest.mm
[modify] https://crrev.com/5fbebad59d0c1ababd1f05e01a4d5aae60bc3243/ios/chrome/browser/sessions/test_session_service.mm
[modify] https://crrev.com/5fbebad59d0c1ababd1f05e01a4d5aae60bc3243/ios/chrome/browser/tabs/tab_model.mm
[modify] https://crrev.com/5fbebad59d0c1ababd1f05e01a4d5aae60bc3243/ios/shared/chrome/browser/ui/browser_list/browser_list_session_service_impl.h
[modify] https://crrev.com/5fbebad59d0c1ababd1f05e01a4d5aae60bc3243/ios/shared/chrome/browser/ui/browser_list/browser_list_session_service_impl.mm

Status: Fixed (was: Assigned)

Sign in to add a comment