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

Issue 23441042: Refactor common invalidation framework types (Closed)

Created:
7 years, 3 months ago by rlarocque
Modified:
7 years, 2 months ago
CC:
chromium-reviews, tim+watch_chromium.org, chromium-apps-reviews_chromium.org, rsimha+watch_chromium.org, haitaol+watch_chromium.org, extensions-reviews_chromium.org
Visibility:
Public.

Description

Refactor common invalidation framework types Convert the Invalidation struct into a class. This allows us to hide its members, so we can do things like add a DCHECK to make sure we never access the payload field of an unknown version invalidation. It also lets us use factory methods and constructors to initialize it rather than having to initialize its fields one by one. Convert the ObjectIdInvalidationMap from a typedef into a class. Unlike the typedef, the class supports multiple invalidations for the same object ID. It uses the newly introduced SingleObjectInvalidationSet to manage the set of invalidations belonging to a particular ID. Note that the current code still sends only one invalidation per type; that will be changed in a future commit. The end goal of this refactoring is to make these classes smarter so they can help manage the complexity that will be introduced when we implement invalidation 'trickles' support. Note that this commit changes the on-disk format for invalidations, so any invalidations currently stored in the profile may be lost on upgrade. There should be no other notable changes to invalidations behavior in this CL. TBR=brettw BUG=233437 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=226949

Patch Set 1 #

Patch Set 2 : Small fixes #

Patch Set 3 : Attempt to fix Android compile #

Patch Set 4 : More Android fixes #

Patch Set 5 : Another Android fix #

Patch Set 6 : Fix more trybots #

Patch Set 7 : Fix typo #

Patch Set 8 : Fix browser_test #

Patch Set 9 : Fix bad DCHECK #

Patch Set 10 : Rebase #

Patch Set 11 : Rebase #

Total comments: 40

Patch Set 12 : Address some comments #

Patch Set 13 : Address more review comments #

Patch Set 14 : Fix some tests and rearrange Invalidation init from value #

Patch Set 15 : Rebase #

Patch Set 16 : Fixing browser test #

Patch Set 17 : Scoped ptr #

Patch Set 18 : Another browser test fix #

Total comments: 6

Patch Set 19 : ASAN fix #

Patch Set 20 : Attempt to fix Android rebase issue #

Patch Set 21 : Revert accidental comment change #

Total comments: 1

Patch Set 22 : Move DEPS rule #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1314 lines, -871 lines) Patch
M chrome/browser/drive/drive_notification_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +21 lines, -11 lines 0 comments Download
M chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +55 lines, -41 lines 0 comments Download
M chrome/browser/invalidation/DEPS View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/invalidation/fake_invalidation_service.h View 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/invalidation/fake_invalidation_service.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -13 lines 0 comments Download
M chrome/browser/invalidation/invalidation_service_android.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -5 lines 0 comments Download
M chrome/browser/invalidation/invalidation_service_test_template.h View 6 chunks +41 lines, -35 lines 0 comments Download
M chrome/browser/invalidation/invalidator_storage_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/invalidation/p2p_invalidation_service.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/invalidation/p2p_invalidation_service.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/policy/cloud/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/policy/cloud/cloud_policy_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/policy/cloud/cloud_policy_invalidator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +15 lines, -10 lines 0 comments Download
M chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 13 chunks +37 lines, -35 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -7 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.cc View 1 chunk +1 line, -6 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_test.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -5 lines 0 comments Download
M sync/engine/sync_scheduler_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -3 lines 0 comments Download
M sync/internal_api/debug_info_event_listener.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -11 lines 0 comments Download
M sync/internal_api/public/base/DEPS View 1 chunk +4 lines, -0 lines 0 comments Download
A sync/internal_api/public/base/ack_handle.h View 1 2 1 chunk +47 lines, -0 lines 0 comments Download
A + sync/internal_api/public/base/ack_handle.cc View 2 chunks +2 lines, -39 lines 0 comments Download
M sync/internal_api/public/base/invalidation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +51 lines, -37 lines 0 comments Download
M sync/internal_api/public/base/invalidation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +103 lines, -59 lines 0 comments Download
M sync/internal_api/public/base/invalidation_test_util.h View 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/public/base/invalidation_test_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +14 lines, -7 lines 0 comments Download
M sync/internal_api/public/base/model_type_test_util.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -9 lines 0 comments Download
A + sync/internal_api/public/base/object_id_invalidation_map_test_util.h View 2 chunks +3 lines, -4 lines 0 comments Download
A + sync/internal_api/public/base/object_id_invalidation_map_test_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +49 lines, -35 lines 0 comments Download
M sync/internal_api/sync_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +18 lines, -8 lines 0 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -3 lines 0 comments Download
M sync/notifier/invalidation_notifier_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M sync/notifier/invalidator_registrar.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -7 lines 0 comments Download
M sync/notifier/invalidator_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +37 lines, -54 lines 0 comments Download
M sync/notifier/invalidator_registrar_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M sync/notifier/invalidator_test_template.h View 6 chunks +37 lines, -35 lines 0 comments Download
M sync/notifier/non_blocking_invalidator_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M sync/notifier/object_id_invalidation_map.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +51 lines, -24 lines 0 comments Download
M sync/notifier/object_id_invalidation_map.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +81 lines, -62 lines 0 comments Download
D sync/notifier/object_id_invalidation_map_test_util.h View 1 chunk +0 lines, -21 lines 0 comments Download
D sync/notifier/object_id_invalidation_map_test_util.cc View 1 chunk +0 lines, -114 lines 0 comments Download
A sync/notifier/object_id_invalidation_map_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +104 lines, -0 lines 0 comments Download
M sync/notifier/p2p_invalidator.h View 2 chunks +2 lines, -2 lines 0 comments Download
M sync/notifier/p2p_invalidator.cc View 1 2 3 4 5 6 7 8 9 11 chunks +18 lines, -24 lines 0 comments Download
M sync/notifier/p2p_invalidator_unittest.cc View 9 chunks +28 lines, -41 lines 0 comments Download
A sync/notifier/single_object_invalidation_set.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +66 lines, -0 lines 0 comments Download
A sync/notifier/single_object_invalidation_set.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +130 lines, -0 lines 0 comments Download
A sync/notifier/single_object_invalidation_set_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +110 lines, -0 lines 0 comments Download
M sync/notifier/sync_invalidation_listener.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +28 lines, -11 lines 0 comments Download
M sync/notifier/sync_invalidation_listener_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +50 lines, -31 lines 0 comments Download
M sync/sessions/data_type_tracker.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +7 lines, -2 lines 0 comments Download
M sync/sessions/data_type_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +16 lines, -7 lines 0 comments Download
M sync/sessions/nudge_tracker.cc View 1 chunk +6 lines, -5 lines 0 comments Download
M sync/sync_internal_api.gypi View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -1 line 0 comments Download
M sync/sync_notifier.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M sync/sync_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -4 lines 0 comments Download
M sync/tools/sync_listen_notifications.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -6 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
rlarocque
This is a big change, and, unfortunately, not all of it is trivial. This was ...
7 years, 3 months ago (2013-09-09 18:41:24 UTC) #1
rlarocque
On 2013/09/09 18:41:24, rlarocque wrote: > This is a big change, and, unfortunately, not all ...
7 years, 3 months ago (2013-09-18 22:32:19 UTC) #2
tim (not reviewing)
https://codereview.chromium.org/23441042/diff/36001/sync/internal_api/public/base/invalidation.cc File sync/internal_api/public/base/invalidation.cc (right): https://codereview.chromium.org/23441042/diff/36001/sync/internal_api/public/base/invalidation.cc#newcode33 sync/internal_api/public/base/invalidation.cc:33: return Invalidation(id, true, -1, "", AckHandle::CreateUnique()); std::string vs "" ...
7 years, 3 months ago (2013-09-20 21:53:45 UTC) #3
rlarocque
Patch updated. PTAL. https://codereview.chromium.org/23441042/diff/36001/sync/internal_api/public/base/invalidation.cc File sync/internal_api/public/base/invalidation.cc (right): https://codereview.chromium.org/23441042/diff/36001/sync/internal_api/public/base/invalidation.cc#newcode33 sync/internal_api/public/base/invalidation.cc:33: return Invalidation(id, true, -1, "", AckHandle::CreateUnique()); ...
7 years, 3 months ago (2013-09-23 18:38:19 UTC) #4
tim (not reviewing)
https://codereview.chromium.org/23441042/diff/36001/sync/internal_api/public/base/invalidation.cc File sync/internal_api/public/base/invalidation.cc (right): https://codereview.chromium.org/23441042/diff/36001/sync/internal_api/public/base/invalidation.cc#newcode71 sync/internal_api/public/base/invalidation.cc:71: && payload_ == other.payload_; On 2013/09/23 18:38:19, rlarocque wrote: ...
7 years, 2 months ago (2013-09-24 21:16:53 UTC) #5
rlarocque
Patch updated. PTAL. https://codereview.chromium.org/23441042/diff/36001/sync/internal_api/public/base/invalidation.cc File sync/internal_api/public/base/invalidation.cc (right): https://codereview.chromium.org/23441042/diff/36001/sync/internal_api/public/base/invalidation.cc#newcode71 sync/internal_api/public/base/invalidation.cc:71: && payload_ == other.payload_; On 2013/09/24 ...
7 years, 2 months ago (2013-09-25 00:40:00 UTC) #6
rlarocque
ping.
7 years, 2 months ago (2013-09-27 20:21:14 UTC) #7
rlarocque
On 2013/09/27 20:21:14, rlarocque wrote: > ping. Patch set 14 refactors Invalidation::RestFromValue as we discussed ...
7 years, 2 months ago (2013-09-30 18:14:47 UTC) #8
tim (not reviewing)
On 2013/09/30 18:14:47, rlarocque wrote: > On 2013/09/27 20:21:14, rlarocque wrote: > > ping. > ...
7 years, 2 months ago (2013-09-30 18:23:01 UTC) #9
rlarocque
On 2013/09/30 18:23:01, timsteele wrote: > On 2013/09/30 18:14:47, rlarocque wrote: > > On 2013/09/27 ...
7 years, 2 months ago (2013-09-30 22:17:12 UTC) #10
rlarocque
On 2013/09/30 22:17:12, rlarocque wrote: > On 2013/09/30 18:23:01, timsteele wrote: > > On 2013/09/30 ...
7 years, 2 months ago (2013-10-01 18:19:44 UTC) #11
Steve Condie
lgtm https://codereview.chromium.org/23441042/diff/110001/chrome/browser/policy/cloud/cloud_policy_invalidator.cc File chrome/browser/policy/cloud/cloud_policy_invalidator.cc (right): https://codereview.chromium.org/23441042/diff/110001/chrome/browser/policy/cloud/cloud_policy_invalidator.cc#newcode191 chrome/browser/policy/cloud/cloud_policy_invalidator.cc:191: payload = invalidation.payload(); Optional. To avoid making an ...
7 years, 2 months ago (2013-10-01 18:53:10 UTC) #12
Steve Condie
On 2013/10/01 18:53:10, stepco wrote: > lgtm > > https://codereview.chromium.org/23441042/diff/110001/chrome/browser/policy/cloud/cloud_policy_invalidator.cc > File chrome/browser/policy/cloud/cloud_policy_invalidator.cc (right): > ...
7 years, 2 months ago (2013-10-01 18:55:25 UTC) #13
rlarocque
https://codereview.chromium.org/23441042/diff/110001/chrome/browser/policy/cloud/cloud_policy_invalidator.cc File chrome/browser/policy/cloud/cloud_policy_invalidator.cc (right): https://codereview.chromium.org/23441042/diff/110001/chrome/browser/policy/cloud/cloud_policy_invalidator.cc#newcode191 chrome/browser/policy/cloud/cloud_policy_invalidator.cc:191: payload = invalidation.payload(); On 2013/10/01 18:53:10, stepco wrote: > ...
7 years, 2 months ago (2013-10-01 19:29:56 UTC) #14
Joao da Silva
policy/ lgtm https://codereview.chromium.org/23441042/diff/125001/chrome/browser/policy/cloud/DEPS File chrome/browser/policy/cloud/DEPS (right): https://codereview.chromium.org/23441042/diff/125001/chrome/browser/policy/cloud/DEPS#newcode149 chrome/browser/policy/cloud/DEPS:149: "+sync/internal_api/public/base/invalidation.h", Move this above line 35, before ...
7 years, 2 months ago (2013-10-02 08:36:32 UTC) #15
tim (not reviewing)
LGTM for: sync/* chrome/browser/sync/* chrome/browser/invalidations/*
7 years, 2 months ago (2013-10-02 22:48:45 UTC) #16
dcheng
chrome/browser/extensions/api/push_messaging/* LGTM
7 years, 2 months ago (2013-10-02 22:57:38 UTC) #17
rlarocque
Thanks. The latest upload addresses Joao's comments. +TBR=brettw for adding google/cacheinvalidation to the sync/internal_api/public/base/DEPS. Just ...
7 years, 2 months ago (2013-10-02 23:25:06 UTC) #18
satorux1
sorry for the belated response. chrome/browser/drive/drive_notification_manager.cc LGTM
7 years, 2 months ago (2013-10-03 00:50:39 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/23441042/136001
7 years, 2 months ago (2013-10-03 00:52:57 UTC) #20
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests, chrome_frame_net_tests, chrome_frame_tests, chrome_frame_unittests, content_browsertests, content_unittests, ...
7 years, 2 months ago (2013-10-03 03:01:30 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/23441042/136001
7 years, 2 months ago (2013-10-03 16:41:25 UTC) #22
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=205353
7 years, 2 months ago (2013-10-03 23:05:04 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/23441042/136001
7 years, 2 months ago (2013-10-03 23:11:58 UTC) #24
commit-bot: I haz the power
7 years, 2 months ago (2013-10-04 03:51:13 UTC) #25
Message was sent while issue was closed.
Change committed as 226949

Powered by Google App Engine
This is Rietveld 408576698