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

Issue 5705004: [SYNC] Sessions datatype refactor. Most things related to sessions under-the-... (Closed)

Created:
10 years ago by Nicolas Zea
Modified:
9 years, 7 months ago
CC:
chromium-reviews, ncarter (slow), idana, Raghu Simha, ben+cc_chromium.org, arv (Not doing code reviews), Paweł Hajdan Jr., Nicolas Zea, tim (not reviewing)
Visibility:
Public.

Description

[SYNC] Sessions datatype refactor. Most things related to sessions under-the-hood have changed. More tests on the way. BUG=30519, 62753 TEST=unit_tests,sync_integration_tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70645

Patch Set 1 #

Patch Set 2 : Self review, rebase #

Patch Set 3 : Fix typecasting that windows didn't like #

Total comments: 34

Patch Set 4 : Reviewer comments + self review #

Total comments: 7

Patch Set 5 : Rebase #

Total comments: 14

Patch Set 6 : Tests! And the refactors that helped them. And Rebase. And Comments. #

Total comments: 26

Patch Set 7 : Comments. #

Patch Set 8 : '' #

Patch Set 9 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2095 lines, -704 lines) Patch
M chrome/browser/dom_ui/foreign_session_handler.h View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -10 lines 0 comments Download
M chrome/browser/dom_ui/foreign_session_handler.cc View 1 2 3 4 5 6 7 8 4 chunks +141 lines, -60 lines 0 comments Download
M chrome/browser/resources/new_new_tab.js View 1 2 3 4 5 6 7 8 4 chunks +76 lines, -23 lines 0 comments Download
M chrome/browser/sessions/session_id.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/sessions/session_restore.h View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -2 lines 0 comments Download
M chrome/browser/sessions/session_restore.cc View 1 2 3 4 5 6 7 8 6 chunks +85 lines, -43 lines 0 comments Download
M chrome/browser/sessions/session_types.h View 1 2 3 4 5 6 7 8 4 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/sync/engine/syncapi.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/engine/syncapi.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/foreign_session_tracker.h View 1 2 3 4 5 6 1 chunk +111 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/foreign_session_tracker.cc View 1 2 3 4 5 6 1 chunk +143 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/session_change_processor.cc View 1 2 3 4 5 6 7 8 4 chunks +143 lines, -13 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.h View 1 2 3 4 5 6 7 8 3 chunks +295 lines, -101 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.cc View 1 2 3 4 5 6 7 8 7 chunks +709 lines, -319 lines 0 comments Download
A chrome/browser/sync/glue/session_model_associator_unittest.cc View 1 2 3 4 5 6 7 1 chunk +163 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_session_unittest.cc View 1 2 3 4 5 6 7 8 10 chunks +106 lines, -82 lines 0 comments Download
M chrome/browser/sync/protocol/session_specifics.proto View 1 2 3 4 5 6 7 8 2 chunks +20 lines, -10 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/live_sync/live_sessions_sync_test.h View 1 2 3 4 5 6 7 8 6 chunks +52 lines, -32 lines 0 comments Download
M chrome/test/live_sync/single_client_live_sessions_sync_test.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/live_sync/two_client_live_sessions_sync_test.cc View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -7 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Nicolas Zea
+tim for review. More tests are forthcoming.
10 years ago (2010-12-10 21:34:16 UTC) #1
Nicolas Zea
This time actually +tim.
10 years ago (2010-12-10 21:34:41 UTC) #2
tim (not reviewing)
I like where this is going! I'm still trying to grok most of session_model_associator, but ...
10 years ago (2010-12-15 21:14:00 UTC) #3
Nicolas Zea
New version up. Still trying to figure out why windows unit test didn't succeed. http://codereview.chromium.org/5705004/diff/24002/chrome/browser/dom_ui/foreign_session_handler.cc ...
10 years ago (2010-12-16 18:09:18 UTC) #4
tim (not reviewing)
Looking good. Any luck with the tests? Having a TabNodePool test to go in with ...
10 years ago (2010-12-20 18:58:44 UTC) #5
Nicolas Zea
Round...3? http://codereview.chromium.org/5705004/diff/45001/chrome/browser/dom_ui/foreign_session_handler.cc File chrome/browser/dom_ui/foreign_session_handler.cc (right): http://codereview.chromium.org/5705004/diff/45001/chrome/browser/dom_ui/foreign_session_handler.cc#newcode30 chrome/browser/dom_ui/foreign_session_handler.cc:30: static const int kInvalid = -1; On 2010/12/20 ...
10 years ago (2010-12-21 18:12:23 UTC) #6
tim (not reviewing)
Once all comments addressed, this LGTM! http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/session_model_associator.h File chrome/browser/sync/glue/session_model_associator.h (right): http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/session_model_associator.h#newcode49 chrome/browser/sync/glue/session_model_associator.h:49: class ForeignSessionTracker { ...
9 years, 11 months ago (2011-01-04 14:32:46 UTC) #7
Nicolas Zea
9 years, 11 months ago (2011-01-06 01:14:13 UTC) #8
http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
File chrome/browser/sync/glue/session_model_associator.h (right):

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
chrome/browser/sync/glue/session_model_associator.h:49: class
ForeignSessionTracker {
On 2011/01/04 14:32:47, timsteele wrote:
> this should be in a foreign_session_tracker.h/cc file

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
chrome/browser/sync/glue/session_model_associator.h:114: private:
On 2011/01/04 14:32:47, timsteele wrote:
> does the Tracker own all the values in these maps?

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
chrome/browser/sync/glue/session_model_associator.h:201: // Load any ƒoreign
session info stored in sync db and update the sync db
On 2011/01/04 14:32:47, timsteele wrote:
> whoa, fancy f!

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
chrome/browser/sync/glue/session_model_associator.h:298: // Getters.
On 2011/01/04 14:32:47, timsteele wrote:
> don't really need this comment.

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
chrome/browser/sync/glue/session_model_associator.h:311: public:
I did, but since it seemed very session model associator specific, I figured it
was more appropriate in here.

On 2011/01/04 14:32:47, timsteele wrote:
> nit - indent
> 
> Did you consider putting TabNodePool in its own file? Fine for now though.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
chrome/browser/sync/glue/session_model_associator.h:313:
TabNodePool(ProfileSyncService* sync_service,
On 2011/01/04 14:32:47, timsteele wrote:
> can you distinguish / explain why multiple ctors are needed? (see
>
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Functi....
>  Sometimes I prefer a named factory method vs second ctor (i.e.
> TabNodePoolWithMachineTag, maybe not here though).

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
chrome/browser/sync/glue/session_model_associator.h:363: private:
On 2011/01/04 14:32:47, timsteele wrote:
> nit - indent

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
File chrome/browser/sync/glue/session_model_associator_unittest.cc (right):

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
chrome/browser/sync/glue/session_model_associator_unittest.cc:21: class
SessionModelAssociatorTest : public testing::Test {
On 2011/01/04 14:32:47, timsteele wrote:
> note you can do 'typedef testing::Test SessionModelAssociatorTest'; if you
like.
>  Or if you dont think you'll ever need boilerplate (probably not the case
here)
> you could remove this altogether and just use TEST(...,...) below.

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/glue/se...
chrome/browser/sync/glue/session_model_associator_unittest.cc:65:
scoped_ptr<SessionWindow> win(new SessionWindow());
On 2011/01/04 14:32:47, timsteele wrote:
> instead of the extra clause at the end, could we just create a raw pointer
here
> and immediately push_back on session->windows?

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/profile...
File chrome/browser/sync/profile_sync_service_session_unittest.cc (right):

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/profile...
chrome/browser/sync/profile_sync_service_session_unittest.cc:368: // Test the
TabNodePool when it starts off empty
On 2011/01/04 14:32:47, timsteele wrote:
> nit - you should end comments with a period.

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/protoco...
File chrome/browser/sync/protocol/session_specifics.proto (right):

http://codereview.chromium.org/5705004/diff/81001/chrome/browser/sync/protoco...
chrome/browser/sync/protocol/session_specifics.proto:28: // Unique (to the
owner) id for this window.
On 2011/01/04 14:32:47, timsteele wrote:
> nit- indent

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/test/live_sync/live_...
File chrome/test/live_sync/live_sessions_sync_test.h (right):

http://codereview.chromium.org/5705004/diff/81001/chrome/test/live_sync/live_...
chrome/test/live_sync/live_sessions_sync_test.h:252: // Caller owns sessions,
but not ForeignSession objects.
On 2011/01/04 14:32:47, timsteele wrote:
> saying 'Caller owns |sessions|, but not ForeignSession values within' would be
> more clear. unless i'm reading this wrong.

Done.

http://codereview.chromium.org/5705004/diff/81001/chrome/test/live_sync/live_...
chrome/test/live_sync/live_sessions_sync_test.h:311: const TabNavigation&
actual) {
On 2011/01/04 14:32:47, timsteele wrote:
> nit - indent

Done.

Powered by Google App Engine
This is Rietveld 408576698