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

Issue 6182004: [SYNC] Refactor SyncSourceInfo and add support in chrome invalidation client ... (Closed)

Created:
9 years, 11 months ago by Nicolas Zea
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Raghu Simha, ncarter (slow), Paweł Hajdan Jr., tim (not reviewing), idana
Visibility:
Public.

Description

[SYNC] Refactor SyncSourceInfo and add support in chrome invalidation client and syncer thread for passing a datatype-specific payload originating in the invalidation server and directed at the sync frontend server. Also fixes bug with last_sync_time and PostTimeToTypeHistogram, which would get hit when the unit tests were being run. BUG=68572, 69558 TEST=unit Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72685

Patch Set 1 #

Patch Set 2 : Self review. Fix compile error #

Total comments: 6

Patch Set 3 : Comments. Also removed unnecessary LOG(WARNING). #

Total comments: 20

Patch Set 4 : Comments + rebase #

Patch Set 5 : feedback #

Patch Set 6 : Rebase #

Total comments: 8

Patch Set 7 : vector->map + comments #

Total comments: 8

Patch Set 8 : feedback #

Patch Set 9 : missing include #

Total comments: 2

Patch Set 10 : payloads/nudge type merge #

Total comments: 20

Patch Set 11 : Added util functions #

Total comments: 11

Patch Set 12 : Naming + more tests. #

Patch Set 13 : Missing static for global const #

Total comments: 10

Patch Set 14 : Feedback #

Total comments: 3

Patch Set 15 : Done! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+395 lines, -63 lines) Patch
M chrome/browser/sync/engine/download_updates_command.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/syncapi.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +26 lines, -13 lines 0 comments Download
M chrome/browser/sync/engine/syncer.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/syncer_thread.h View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +21 lines, -6 lines 0 comments Download
M chrome/browser/sync/engine/syncer_thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 12 chunks +56 lines, -20 lines 0 comments Download
M chrome/browser/sync/engine/syncer_thread_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +104 lines, -7 lines 0 comments Download
M chrome/browser/sync/engine/syncer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -2 lines 0 comments Download
M chrome/browser/sync/notifier/chrome_invalidation_client.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
MM chrome/browser/sync/notifier/chrome_invalidation_client.cc View 1 2 3 4 5 11 1 chunk +6 lines, -1 line 0 comments Download
MM chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc View 1 2 3 4 5 11 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/notifier/server_notifier_thread.h View 1 2 3 4 5 6 7 1 chunk +8 lines, -1 line 0 comments Download
M chrome/browser/sync/notifier/server_notifier_thread.cc View 1 2 3 4 5 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/sync/sessions/sync_session.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +33 lines, -2 lines 0 comments Download
M chrome/browser/sync/sessions/sync_session.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +48 lines, -1 line 0 comments Download
M chrome/browser/sync/sessions/sync_session_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +59 lines, -0 lines 0 comments Download
M chrome/browser/sync/tools/sync_listen_notifications.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/test/sync/engine/syncer_command_test.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +9 lines, -2 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Nicolas Zea
+fred for chrome invalidation code, +tim for sync internals
9 years, 11 months ago (2011-01-11 22:15:03 UTC) #1
tim (not reviewing)
LGTM with a few comments http://codereview.chromium.org/6182004/diff/16001/chrome/browser/sync/engine/syncer_thread.cc File chrome/browser/sync/engine/syncer_thread.cc (right): http://codereview.chromium.org/6182004/diff/16001/chrome/browser/sync/engine/syncer_thread.cc#newcode663 chrome/browser/sync/engine/syncer_thread.cc:663: sync_source_types.set(); hmm... just enabled ...
9 years, 11 months ago (2011-01-11 23:20:02 UTC) #2
Nicolas Zea
http://codereview.chromium.org/6182004/diff/16001/chrome/browser/sync/engine/syncer_thread.cc File chrome/browser/sync/engine/syncer_thread.cc (right): http://codereview.chromium.org/6182004/diff/16001/chrome/browser/sync/engine/syncer_thread.cc#newcode663 chrome/browser/sync/engine/syncer_thread.cc:663: sync_source_types.set(); On 2011/01/11 23:20:02, timsteele wrote: > hmm... just ...
9 years, 11 months ago (2011-01-12 00:11:37 UTC) #3
akalin
http://codereview.chromium.org/6182004/diff/32001/chrome/browser/sync/engine/syncapi.cc File chrome/browser/sync/engine/syncapi.cc (right): http://codereview.chromium.org/6182004/diff/32001/chrome/browser/sync/engine/syncapi.cc#newcode2287 chrome/browser/sync/engine/syncapi.cc:2287: int milliseconds_from_now = 250; Change to something like "const ...
9 years, 11 months ago (2011-01-12 09:55:19 UTC) #4
Nicolas Zea
http://codereview.chromium.org/6182004/diff/32001/chrome/browser/sync/engine/syncapi.cc File chrome/browser/sync/engine/syncapi.cc (right): http://codereview.chromium.org/6182004/diff/32001/chrome/browser/sync/engine/syncapi.cc#newcode2287 chrome/browser/sync/engine/syncapi.cc:2287: int milliseconds_from_now = 250; On 2011/01/12 09:55:19, akalin wrote: ...
9 years, 11 months ago (2011-01-13 19:17:30 UTC) #5
akalin
http://codereview.chromium.org/6182004/diff/32001/chrome/browser/sync/engine/syncer_thread.cc File chrome/browser/sync/engine/syncer_thread.cc (right): http://codereview.chromium.org/6182004/diff/32001/chrome/browser/sync/engine/syncer_thread.cc#newcode807 chrome/browser/sync/engine/syncer_thread.cc:807: vault_.datatype_payloads_[i] = payloads[i]; // Overwrite old payloads. On 2011/01/13 ...
9 years, 11 months ago (2011-01-13 19:47:40 UTC) #6
Nicolas Zea
Changes made based on feedback. Sorry about the multiple uploads, I forgot I didn't have ...
9 years, 11 months ago (2011-01-18 06:07:23 UTC) #7
Nicolas Zea
Fred: Ping. On 2011/01/18 06:07:23, nzea wrote: > Changes made based on feedback. Sorry about ...
9 years, 11 months ago (2011-01-19 18:24:50 UTC) #8
akalin
http://codereview.chromium.org/6182004/diff/51003/chrome/browser/sync/engine/download_updates_command.cc File chrome/browser/sync/engine/download_updates_command.cc (left): http://codereview.chromium.org/6182004/diff/51003/chrome/browser/sync/engine/download_updates_command.cc#oldcode63 chrome/browser/sync/engine/download_updates_command.cc:63: get_updates->mutable_caller_info()->set_source( Add TODO here talking about how we need ...
9 years, 11 months ago (2011-01-19 22:14:52 UTC) #9
Nicolas Zea
Almost there! http://codereview.chromium.org/6182004/diff/51003/chrome/browser/sync/engine/download_updates_command.cc File chrome/browser/sync/engine/download_updates_command.cc (left): http://codereview.chromium.org/6182004/diff/51003/chrome/browser/sync/engine/download_updates_command.cc#oldcode63 chrome/browser/sync/engine/download_updates_command.cc:63: get_updates->mutable_caller_info()->set_source( On 2011/01/19 22:14:52, akalin wrote: > ...
9 years, 11 months ago (2011-01-19 22:54:55 UTC) #10
akalin
http://codereview.chromium.org/6182004/diff/95003/chrome/browser/sync/sessions/sync_session.h File chrome/browser/sync/sessions/sync_session.h (right): http://codereview.chromium.org/6182004/diff/95003/chrome/browser/sync/sessions/sync_session.h#newcode57 chrome/browser/sync/sessions/sync_session.h:57: syncable::ModelTypeBitSet types; So since we have the payloads map, ...
9 years, 11 months ago (2011-01-20 00:28:19 UTC) #11
Nicolas Zea
Decent amount rewritten this time. I feel close now! http://codereview.chromium.org/6182004/diff/95003/chrome/browser/sync/sessions/sync_session.h File chrome/browser/sync/sessions/sync_session.h (right): http://codereview.chromium.org/6182004/diff/95003/chrome/browser/sync/sessions/sync_session.h#newcode57 chrome/browser/sync/sessions/sync_session.h:57: ...
9 years, 11 months ago (2011-01-20 02:17:32 UTC) #12
akalin
Getting closer! Mostly nits and requests for utility functions. http://codereview.chromium.org/6182004/diff/107021/chrome/browser/sync/engine/syncapi.cc File chrome/browser/sync/engine/syncapi.cc (right): http://codereview.chromium.org/6182004/diff/107021/chrome/browser/sync/engine/syncapi.cc#newcode2218 chrome/browser/sync/engine/syncapi.cc:2218: ...
9 years, 11 months ago (2011-01-21 19:50:09 UTC) #13
Nicolas Zea
Refactored to use util methods where necessary and addressed comments. http://codereview.chromium.org/6182004/diff/107021/chrome/browser/sync/engine/syncapi.cc File chrome/browser/sync/engine/syncapi.cc (right): http://codereview.chromium.org/6182004/diff/107021/chrome/browser/sync/engine/syncapi.cc#newcode2218 ...
9 years, 11 months ago (2011-01-21 21:57:44 UTC) #14
akalin
Almost there! http://codereview.chromium.org/6182004/diff/152002/chrome/browser/sync/engine/syncer_thread.cc File chrome/browser/sync/engine/syncer_thread.cc (right): http://codereview.chromium.org/6182004/diff/152002/chrome/browser/sync/engine/syncer_thread.cc#newcode795 chrome/browser/sync/engine/syncer_thread.cc:795: for (ModelTypeMap::const_iterator i = I think this ...
9 years, 11 months ago (2011-01-24 22:17:28 UTC) #15
Nicolas Zea
Done and done. http://codereview.chromium.org/6182004/diff/152002/chrome/browser/sync/engine/syncer_thread.cc File chrome/browser/sync/engine/syncer_thread.cc (right): http://codereview.chromium.org/6182004/diff/152002/chrome/browser/sync/engine/syncer_thread.cc#newcode795 chrome/browser/sync/engine/syncer_thread.cc:795: for (ModelTypeMap::const_iterator i = On 2011/01/24 ...
9 years, 11 months ago (2011-01-25 00:29:13 UTC) #16
akalin
Almost almost there! http://codereview.chromium.org/6182004/diff/152002/chrome/browser/sync/sessions/sync_session.h File chrome/browser/sync/sessions/sync_session.h (right): http://codereview.chromium.org/6182004/diff/152002/chrome/browser/sync/sessions/sync_session.h#newcode26 chrome/browser/sync/sessions/sync_session.h:26: #include "chrome/browser/sync/engine/model_safe_worker.h" On 2011/01/25 00:29:14, nzea ...
9 years, 11 months ago (2011-01-26 01:15:17 UTC) #17
Nicolas Zea
So close. http://codereview.chromium.org/6182004/diff/165004/chrome/browser/sync/engine/syncapi.cc File chrome/browser/sync/engine/syncapi.cc (right): http://codereview.chromium.org/6182004/diff/165004/chrome/browser/sync/engine/syncapi.cc#newcode2229 chrome/browser/sync/engine/syncapi.cc:2229: model_types.set(); On 2011/01/26 01:15:17, akalin wrote: > ...
9 years, 11 months ago (2011-01-26 01:41:28 UTC) #18
akalin
9 years, 11 months ago (2011-01-26 10:35:26 UTC) #19
LGTM after fixing the nits below.

http://codereview.chromium.org/6182004/diff/69003/chrome/browser/sync/engine/...
File chrome/browser/sync/engine/syncer_thread.cc (right):

http://codereview.chromium.org/6182004/diff/69003/chrome/browser/sync/engine/...
chrome/browser/sync/engine/syncer_thread.cc:35: using sessions::TypePayloadMap;
alphabetize

http://codereview.chromium.org/6182004/diff/69003/chrome/browser/sync/session...
File chrome/browser/sync/sessions/sync_session_unittest.cc (right):

http://codereview.chromium.org/6182004/diff/69003/chrome/browser/sync/session...
chrome/browser/sync/sessions/sync_session_unittest.cc:257: TypePayloadMap map =
ModelTypeBitSetToTypePayloadMap(types, payload);
Best not to name a variable the same as an existing type, at least in C++.  I
think you use 'map' in other places, too.

http://codereview.chromium.org/6182004/diff/69003/chrome/browser/sync/session...
chrome/browser/sync/sessions/sync_session_unittest.cc:267:
EXPECT_TRUE(map[syncable::BOOKMARKS] == payload);
use EXPECT_EQ

Powered by Google App Engine
This is Rietveld 408576698