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

Issue 10989027: Split TabRestoreService into InMemoryTRS and PersistentTRS (Closed)

Created:
8 years, 2 months ago by Philippe
Modified:
8 years, 1 month ago
Reviewers:
Yaron, sky, pliard
CC:
chromium-reviews, marja+watch_chromium.org, digit1, felipeg
Visibility:
Public.

Description

Split TabRestoreService into InMemoryTRS and PersistentTRS This is a refactoring needed as part of Chrome for Android upstreaming. This refactors TabRestoreService by making it an interface and splitting the initial TabRestoreService class into two classes implementing that interface: - InMemoryTabRestoreService: A tab restore service that doesn't persist its state to disk. This is used on Android where tab persistence is implemented on the application side in Java. - PersistentTabRestoreService: This is equivalent in terms of features/behaviors to the initial TabRestoreService. All non-Android clients should (indirectly) use this. Note that clients should still use TabRestoreServiceFactory to get a TabRestoreService instance. BUG=138955 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=164623

Patch Set 1 #

Patch Set 2 : #

Total comments: 3

Patch Set 3 : Split TRS into InMemoryTRS and PersistentTRS #

Total comments: 5

Patch Set 4 : Test --similarity git cl upload option #

Patch Set 5 : Move session backend-related code to PersistentTRS::Delegate + polishing #

Patch Set 6 : Make PersistentTRS::Delegate's methods out-of-line to preserve SCM history #

Patch Set 7 : Fix build on Mac (not tested locally) #

Total comments: 10

Patch Set 8 : Add TabRestoreServiceHelper #

Patch Set 9 : Fix some comments #

Total comments: 14

Patch Set 10 : Address Scott's comments #

Total comments: 17

Patch Set 11 : Address Scott's comments #

Patch Set 12 : Remove unused include in in_memory_tab_restore_service.cc #

Patch Set 13 : GYP out PersistentTRS files on Android #

Patch Set 14 : GYP out InMemoryTRS on non-Android and fix incorrect comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+972 lines, -4008 lines) Patch
M chrome/browser/sessions/base_session_service.h View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -3 lines 0 comments Download
A chrome/browser/sessions/in_memory_tab_restore_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +51 lines, -0 lines 0 comments Download
A chrome/browser/sessions/in_memory_tab_restore_service.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +90 lines, -0 lines 0 comments Download
A chrome/browser/sessions/persistent_tab_restore_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +60 lines, -0 lines 0 comments Download
A + chrome/browser/sessions/persistent_tab_restore_service.cc View 1 2 3 4 5 6 7 8 9 10 22 chunks +422 lines, -689 lines 0 comments Download
A + chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 27 chunks +86 lines, -70 lines 0 comments Download
M chrome/browser/sessions/session_service.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/sessions/tab_restore_service.h View 1 2 3 4 5 6 7 3 chunks +21 lines, -229 lines 0 comments Download
M chrome/browser/sessions/tab_restore_service.cc View 1 2 3 chunks +5 lines, -1213 lines 0 comments Download
D chrome/browser/sessions/tab_restore_service_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -679 lines 0 comments Download
M chrome/browser/sessions/tab_restore_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -7 lines 0 comments Download
A + chrome/browser/sessions/tab_restore_service_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +67 lines, -281 lines 0 comments Download
A + chrome/browser/sessions/tab_restore_service_helper.cc View 1 2 3 4 5 6 7 8 21 chunks +133 lines, -831 lines 0 comments Download
M chrome/browser/ui/android/tab_restore_service_delegate_android.cc View 1 2 1 chunk +15 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/gtk/global_history_menu.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +10 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 47 (0 generated)
Philippe
8 years, 2 months ago (2012-09-26 17:00:05 UTC) #1
sky
https://chromiumcodereview.appspot.com/10989027/diff/8002/chrome/browser/sessions/session_backend_android.cc File chrome/browser/sessions/session_backend_android.cc (right): https://chromiumcodereview.appspot.com/10989027/diff/8002/chrome/browser/sessions/session_backend_android.cc#newcode10 chrome/browser/sessions/session_backend_android.cc:10: // Dummy session backend for Android. Tab and session ...
8 years, 2 months ago (2012-09-26 20:54:21 UTC) #2
Philippe
https://chromiumcodereview.appspot.com/10989027/diff/8002/chrome/browser/sessions/session_backend_android.cc File chrome/browser/sessions/session_backend_android.cc (right): https://chromiumcodereview.appspot.com/10989027/diff/8002/chrome/browser/sessions/session_backend_android.cc#newcode10 chrome/browser/sessions/session_backend_android.cc:10: // Dummy session backend for Android. Tab and session ...
8 years, 2 months ago (2012-09-26 21:28:09 UTC) #3
Philippe
https://chromiumcodereview.appspot.com/10989027/diff/8002/chrome/browser/sessions/session_backend_android.cc File chrome/browser/sessions/session_backend_android.cc (right): https://chromiumcodereview.appspot.com/10989027/diff/8002/chrome/browser/sessions/session_backend_android.cc#newcode10 chrome/browser/sessions/session_backend_android.cc:10: // Dummy session backend for Android. Tab and session ...
8 years, 2 months ago (2012-09-26 21:38:10 UTC) #4
sky
On Wed, Sep 26, 2012 at 2:28 PM, <pliard@chromium.org> wrote: > > https://chromiumcodereview.appspot.com/10989027/diff/8002/chrome/browser/sessions/session_backend_android.cc > File ...
8 years, 2 months ago (2012-09-26 23:00:59 UTC) #5
Philippe
On 2012/09/26 23:00:59, sky wrote: > On Wed, Sep 26, 2012 at 2:28 PM, <mailto:pliard@chromium.org> ...
8 years, 2 months ago (2012-09-26 23:29:35 UTC) #6
Philippe
On 2012/09/26 23:29:35, Philippe wrote: > On 2012/09/26 23:00:59, sky wrote: > > On Wed, ...
8 years, 2 months ago (2012-09-27 23:51:35 UTC) #7
Philippe
On 2012/09/27 23:51:35, Philippe wrote: > On 2012/09/26 23:29:35, Philippe wrote: > > On 2012/09/26 ...
8 years, 2 months ago (2012-09-28 18:14:56 UTC) #8
sky
I think it makes more sense to introduce an interface that RecentlyClosedTabsHandler talks to. TabRestoreService ...
8 years, 2 months ago (2012-09-28 20:26:51 UTC) #9
Philippe
On 2012/09/28 20:26:51, sky wrote: > I think it makes more sense to introduce an ...
8 years, 2 months ago (2012-09-28 23:00:34 UTC) #10
sky
Why would this be that big? RecentlyClosedTabsHandler doesn't use that much of TabRestoreService, which should ...
8 years, 2 months ago (2012-09-28 23:07:18 UTC) #11
Philippe
On 2012/09/28 23:07:18, sky wrote: > Why would this be that big? RecentlyClosedTabsHandler doesn't use ...
8 years, 2 months ago (2012-09-28 23:23:41 UTC) #12
Philippe
On 2012/09/28 23:23:41, Philippe wrote: > On 2012/09/28 23:07:18, sky wrote: > > Why would ...
8 years, 2 months ago (2012-09-28 23:25:35 UTC) #13
pliard
I will try to abstract TabRestoreService and see how it looks. On Sat, Sep 29, ...
8 years, 2 months ago (2012-09-29 00:06:50 UTC) #14
Philippe
I came across another issue. I was assuming that TabRestoreService was inheriting from BaseSessionService only ...
8 years, 2 months ago (2012-09-29 01:51:22 UTC) #15
sky
Do you need to change all clients, or just RecentlyClosedTabsHandler? Does android use ProfileKeyedService? -Scott ...
8 years, 2 months ago (2012-10-01 14:29:38 UTC) #16
Philippe
On 2012/10/01 14:29:38, sky wrote: > Do you need to change all clients, or just ...
8 years, 2 months ago (2012-10-01 17:49:39 UTC) #17
sky
There is only one method in PKS: Shutdown(). You can expose a similar named method ...
8 years, 2 months ago (2012-10-02 20:36:12 UTC) #18
pliard
I started adding a new PersistentTabRestoreService class inheriting from TabRestoreService which I'm stripping to fully ...
8 years, 2 months ago (2012-10-05 15:36:31 UTC) #19
sky
As long as TRS is pure virtual, SGTM. If not, and you're close to done ...
8 years, 2 months ago (2012-10-10 20:39:33 UTC) #20
Philippe
On 2012/10/10 20:39:33, sky wrote: > As long as TRS is pure virtual, SGTM. If ...
8 years, 2 months ago (2012-10-17 16:02:08 UTC) #21
Philippe
On 2012/10/17 16:02:08, Philippe wrote: > On 2012/10/10 20:39:33, sky wrote: > > As long ...
8 years, 2 months ago (2012-10-17 16:48:31 UTC) #22
sky
http://codereview.chromium.org/10989027/diff/23001/chrome/browser/sessions/persistent_tab_restore_service.h File chrome/browser/sessions/persistent_tab_restore_service.h (right): http://codereview.chromium.org/10989027/diff/23001/chrome/browser/sessions/persistent_tab_restore_service.h#newcode5 chrome/browser/sessions/persistent_tab_restore_service.h:5: #include <vector> Make sure you svn cp so that ...
8 years, 2 months ago (2012-10-17 21:49:31 UTC) #23
Philippe
http://codereview.chromium.org/10989027/diff/23001/chrome/browser/sessions/persistent_tab_restore_service.h File chrome/browser/sessions/persistent_tab_restore_service.h (right): http://codereview.chromium.org/10989027/diff/23001/chrome/browser/sessions/persistent_tab_restore_service.h#newcode5 chrome/browser/sessions/persistent_tab_restore_service.h:5: #include <vector> On 2012/10/17 21:49:31, sky wrote: > Make ...
8 years, 2 months ago (2012-10-18 09:41:41 UTC) #24
Philippe
http://codereview.chromium.org/10989027/diff/23001/chrome/browser/sessions/persistent_tab_restore_service.h File chrome/browser/sessions/persistent_tab_restore_service.h (right): http://codereview.chromium.org/10989027/diff/23001/chrome/browser/sessions/persistent_tab_restore_service.h#newcode5 chrome/browser/sessions/persistent_tab_restore_service.h:5: #include <vector> On 2012/10/18 09:41:41, Philippe wrote: > On ...
8 years, 2 months ago (2012-10-18 09:54:06 UTC) #25
Philippe
On 2012/10/18 09:54:06, Philippe wrote: > http://codereview.chromium.org/10989027/diff/23001/chrome/browser/sessions/persistent_tab_restore_service.h > File chrome/browser/sessions/persistent_tab_restore_service.h (right): > > http://codereview.chromium.org/10989027/diff/23001/chrome/browser/sessions/persistent_tab_restore_service.h#newcode5 > ...
8 years, 2 months ago (2012-10-18 15:26:02 UTC) #26
sky
The important thing is history is preserved. -Scott On Thu, Oct 18, 2012 at 2:41 ...
8 years, 2 months ago (2012-10-18 17:18:20 UTC) #27
sky
http://codereview.chromium.org/10989027/diff/27015/chrome/browser/sessions/base_session_service.h File chrome/browser/sessions/base_session_service.h (left): http://codereview.chromium.org/10989027/diff/27015/chrome/browser/sessions/base_session_service.h#oldcode50 chrome/browser/sessions/base_session_service.h:50: // Deletes the last session. Why remove this comment? ...
8 years, 2 months ago (2012-10-22 13:51:35 UTC) #28
Philippe
https://chromiumcodereview.appspot.com/10989027/diff/27015/chrome/browser/sessions/base_session_service.h File chrome/browser/sessions/base_session_service.h (left): https://chromiumcodereview.appspot.com/10989027/diff/27015/chrome/browser/sessions/base_session_service.h#oldcode50 chrome/browser/sessions/base_session_service.h:50: // Deletes the last session. On 2012/10/22 13:51:35, sky ...
8 years, 2 months ago (2012-10-23 15:07:36 UTC) #29
sky
This is much closer to what I intended. Thank you! Does android run tab_restore_service_browsertest.cc ? ...
8 years, 2 months ago (2012-10-24 13:51:25 UTC) #30
Philippe
Thanks Scott! Indeed, tab_restore_service_browsertest.cc is not built/run on Android. Would you mind if I address ...
8 years, 2 months ago (2012-10-24 15:42:47 UTC) #31
sky
I think you're almost there. https://chromiumcodereview.appspot.com/10989027/diff/61002/chrome/browser/sessions/in_memory_tab_restore_service.cc File chrome/browser/sessions/in_memory_tab_restore_service.cc (right): https://chromiumcodereview.appspot.com/10989027/diff/61002/chrome/browser/sessions/in_memory_tab_restore_service.cc#newcode72 chrome/browser/sessions/in_memory_tab_restore_service.cc:72: NOTIMPLEMENTED(); NOTIMPLEMENTED doesn't seem ...
8 years, 2 months ago (2012-10-25 00:45:44 UTC) #32
Philippe
Thanks Scott. https://chromiumcodereview.appspot.com/10989027/diff/61002/chrome/browser/sessions/in_memory_tab_restore_service.cc File chrome/browser/sessions/in_memory_tab_restore_service.cc (right): https://chromiumcodereview.appspot.com/10989027/diff/61002/chrome/browser/sessions/in_memory_tab_restore_service.cc#newcode72 chrome/browser/sessions/in_memory_tab_restore_service.cc:72: NOTIMPLEMENTED(); On 2012/10/25 00:45:44, sky wrote: > ...
8 years, 1 month ago (2012-10-25 15:37:07 UTC) #33
sky
https://chromiumcodereview.appspot.com/10989027/diff/61002/chrome/browser/sessions/tab_restore_service_helper.h File chrome/browser/sessions/tab_restore_service_helper.h (right): https://chromiumcodereview.appspot.com/10989027/diff/61002/chrome/browser/sessions/tab_restore_service_helper.h#newcode45 chrome/browser/sessions/tab_restore_service_helper.h:45: virtual void OnClearEntries(); On 2012/10/25 15:37:07, Philippe wrote: > ...
8 years, 1 month ago (2012-10-25 16:21:01 UTC) #34
sky
And note, if doing as I suggested requires a couple more methods so be. Its ...
8 years, 1 month ago (2012-10-25 16:21:28 UTC) #35
Philippe
On 2012/10/25 16:21:28, sky wrote: > And note, if doing as I suggested requires a ...
8 years, 1 month ago (2012-10-25 16:52:08 UTC) #36
sky
On Thu, Oct 25, 2012 at 9:52 AM, <pliard@chromium.org> wrote: > On 2012/10/25 16:21:28, sky ...
8 years, 1 month ago (2012-10-25 19:15:46 UTC) #37
sky
LGTM
8 years, 1 month ago (2012-10-25 19:15:50 UTC) #38
Philippe
On 2012/10/25 19:15:50, sky wrote: > LGTM Thanks Scott!
8 years, 1 month ago (2012-10-26 07:49:39 UTC) #39
Philippe
FYI, I've uploaded two new (small) patch sets GYPing out the appropriate TRS files on ...
8 years, 1 month ago (2012-10-26 11:46:29 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/10989027/80001
8 years, 1 month ago (2012-10-26 11:46:54 UTC) #41
commit-bot: I haz the power
Commit queue patch verification failed without an error message. Something went wrong, probably a crash, ...
8 years, 1 month ago (2012-10-26 15:53:51 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/10989027/80001
8 years, 1 month ago (2012-10-26 15:54:40 UTC) #43
commit-bot: I haz the power
Failed to request the patch to try. Please note that binary filesare still unsupported at ...
8 years, 1 month ago (2012-10-26 15:56:24 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/10989027/80001
8 years, 1 month ago (2012-10-29 09:08:15 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/10989027/80001
8 years, 1 month ago (2012-10-29 11:48:22 UTC) #46
commit-bot: I haz the power
8 years, 1 month ago (2012-10-29 11:56:55 UTC) #47
Change committed as 164623

Powered by Google App Engine
This is Rietveld 408576698