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

Issue 2674893002: Refactor TabModel initialisation from a saved session. (Closed)

Created:
3 years, 10 months ago by sdefresne
Modified:
3 years, 10 months ago
CC:
chromium-reviews, marq+watch_chromium.org, pkl (ping after 24h if needed), noyau+watch_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor TabModel initialisation from a saved session. There was two code path to restore Tabs from a saved sessions, one in the TabModel initialiser and one in -restoreSessionWindow:. They were almost the same with the few differences (used helper methods vs manipulating _tabs directly, thus not sending notifications). When considering the fact that there are no observer registered at the time the initialiser is called, nor are there any Tabs in the _tabs array, the only significant difference left was whether the state was persisted after updating _currentTab. Refactor the initialiser to call -restoreSessionWindow: method by adding an helper method allowing to choose whether the state should be persisted or not. While restoring a session in the initialiser via the shared code path, the selection of the selected tab will be recorded to be reported as a metric. To not change the metric, the count is reset after restoring the session in the initialiser. BUG=687207 Review-Url: https://codereview.chromium.org/2674893002 Cr-Commit-Position: refs/heads/master@{#448598} Committed: https://chromium.googlesource.com/chromium/src/+/44c09dc47b0df3de230ad862c98ffeccf1997699

Patch Set 1 #

Patch Set 2 : Remove unused local variable. #

Total comments: 10

Patch Set 3 : Address comments & rebase on https://codereview.chromium.org/2678823002. #

Patch Set 4 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -91 lines) Patch
M ios/chrome/browser/tabs/tab_model.mm View 1 2 5 chunks +87 lines, -91 lines 0 comments Download

Messages

Total messages: 19 (10 generated)
sdefresne
Please take a look.
3 years, 10 months ago (2017-02-03 15:07:43 UTC) #4
rohitrao (ping after 24h)
lgtm https://codereview.chromium.org/2674893002/diff/20001/ios/chrome/browser/tabs/tab_model.mm File ios/chrome/browser/tabs/tab_model.mm (right): https://codereview.chromium.org/2674893002/diff/20001/ios/chrome/browser/tabs/tab_model.mm#newcode272 ios/chrome/browser/tabs/tab_model.mm:272: [self restoreSessionWindow:window persistState:NO]; Is it worth DCHECKing that ...
3 years, 10 months ago (2017-02-06 13:45:40 UTC) #7
sdefresne
I've answered your questions. Could you take another look? https://codereview.chromium.org/2674893002/diff/20001/ios/chrome/browser/tabs/tab_model.mm File ios/chrome/browser/tabs/tab_model.mm (right): https://codereview.chromium.org/2674893002/diff/20001/ios/chrome/browser/tabs/tab_model.mm#newcode272 ios/chrome/browser/tabs/tab_model.mm:272: ...
3 years, 10 months ago (2017-02-06 14:10:45 UTC) #9
rohitrao (ping after 24h)
https://codereview.chromium.org/2674893002/diff/20001/ios/chrome/browser/tabs/tab_model.mm File ios/chrome/browser/tabs/tab_model.mm (right): https://codereview.chromium.org/2674893002/diff/20001/ios/chrome/browser/tabs/tab_model.mm#newcode272 ios/chrome/browser/tabs/tab_model.mm:272: [self restoreSessionWindow:window persistState:NO]; As an example, what would happen ...
3 years, 10 months ago (2017-02-06 14:15:57 UTC) #10
sdefresne
https://codereview.chromium.org/2674893002/diff/20001/ios/chrome/browser/tabs/tab_model.mm File ios/chrome/browser/tabs/tab_model.mm (right): https://codereview.chromium.org/2674893002/diff/20001/ios/chrome/browser/tabs/tab_model.mm#newcode272 ios/chrome/browser/tabs/tab_model.mm:272: [self restoreSessionWindow:window persistState:NO]; On 2017/02/06 14:15:57, rohitrao wrote: > ...
3 years, 10 months ago (2017-02-06 14:34:02 UTC) #11
sdefresne
PTAL
3 years, 10 months ago (2017-02-06 17:53:01 UTC) #12
rohitrao (ping after 24h)
lgtm
3 years, 10 months ago (2017-02-06 17:55:00 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2674893002/60001
3 years, 10 months ago (2017-02-07 10:49:31 UTC) #16
commit-bot: I haz the power
3 years, 10 months ago (2017-02-07 11:13:47 UTC) #19
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/44c09dc47b0df3de230ad862c98f...

Powered by Google App Engine
This is Rietveld 408576698