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

Issue 247983002: Keep track of which attachments are referenced by which sync entries. (Closed)

Created:
6 years, 8 months ago by maniscalco
Modified:
6 years, 7 months ago
CC:
chromium-reviews, tim+watch_chromium.org, haitaol+watch_chromium.org, albertb+watch_chromium.org, maniscalco+watch_chromium.org
Visibility:
Public.

Description

Keep track of which attachments are referenced by which sync entries. PutAttachmentMetadata on MutableEntry now notifies the Directory when the attachments associated with an entry change. Give Directory::InitializeIndices a ScopedKernelLock to be consistent and make it easier to ensure we are locking when we need to. GenericChangeProcess passes new attachments to AttachmentService for storage and upload. Add an output parameter to GenericChangeProcessor's HandleActionAdd and HandleActionUpdate methods so they can keep track of potentially new attachments and pass them to AttachmentService for storage/upload. Convert AttachmentService's OnSyncDataAdd to StoreAttachments. Implement HasAttachmentNotOnServer. BUG=348625, 353303, 354530, 356266 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267617

Patch Set 1 : Rebase with master. #

Patch Set 2 : Fix "copy yourself bug". #

Total comments: 4

Patch Set 3 : Apply feedback from pavely. git cl format. Add tests. Fix bug exposed by tests. #

Patch Set 4 : Move some common test code into methods to reduce duplication. #

Patch Set 5 : FakeAttachmentService::StoreAttachments now calls AttachmentStore::Write. #

Total comments: 2

Patch Set 6 : Rework tests and move AttachmentIdProto creation to avoid violating DEPS. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+852 lines, -167 lines) Patch
M components/sync_driver/generic_change_processor.h View 1 2 1 chunk +13 lines, -4 lines 0 comments Download
M components/sync_driver/generic_change_processor.cc View 1 2 10 chunks +92 lines, -25 lines 0 comments Download
M components/sync_driver/generic_change_processor_unittest.cc View 1 2 3 4 6 chunks +107 lines, -8 lines 0 comments Download
M sync/api/attachments/attachment_id.cc View 1 2 3 4 5 2 chunks +2 lines, -5 lines 0 comments Download
M sync/api/attachments/attachment_service.h View 2 chunks +18 lines, -5 lines 0 comments Download
M sync/api/attachments/attachment_service_proxy.h View 2 chunks +4 lines, -2 lines 0 comments Download
M sync/api/attachments/attachment_service_proxy.cc View 1 2 3 chunks +21 lines, -4 lines 0 comments Download
M sync/api/attachments/attachment_service_proxy_unittest.cc View 6 chunks +20 lines, -4 lines 0 comments Download
M sync/api/attachments/fake_attachment_service.h View 1 2 3 4 2 chunks +4 lines, -1 line 0 comments Download
M sync/api/attachments/fake_attachment_service.cc View 1 2 3 4 2 chunks +20 lines, -3 lines 0 comments Download
M sync/api/sync_data.h View 1 2 1 chunk +10 lines, -5 lines 0 comments Download
M sync/api/sync_data.cc View 1 2 3 chunks +16 lines, -6 lines 0 comments Download
M sync/engine/get_commit_ids.cc View 1 chunk +7 lines, -3 lines 0 comments Download
M sync/internal_api/base_node.cc View 1 chunk +7 lines, -4 lines 0 comments Download
A sync/internal_api/public/base/attachment_id_proto.h View 1 2 3 4 5 1 chunk +20 lines, -0 lines 0 comments Download
A sync/internal_api/public/base/attachment_id_proto.cc View 1 2 3 4 5 1 chunk +19 lines, -0 lines 0 comments Download
M sync/internal_api/public/base_transaction.h View 1 chunk +3 lines, -0 lines 0 comments Download
M sync/internal_api/public/write_node.h View 1 chunk +4 lines, -0 lines 0 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 2 3 4 5 20 chunks +167 lines, -72 lines 0 comments Download
M sync/internal_api/write_node.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M sync/protocol/attachments.proto View 1 chunk +9 lines, -0 lines 0 comments Download
M sync/sync_internal_api.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M sync/syncable/directory.h View 1 2 3 4 5 6 chunks +43 lines, -1 line 0 comments Download
M sync/syncable/directory.cc View 1 2 3 4 5 10 chunks +68 lines, -2 lines 0 comments Download
M sync/syncable/directory_backing_store.cc View 1 2 2 chunks +9 lines, -0 lines 0 comments Download
M sync/syncable/directory_unittest.h View 1 2 3 4 5 2 chunks +15 lines, -4 lines 0 comments Download
M sync/syncable/directory_unittest.cc View 1 2 3 4 5 5 chunks +126 lines, -9 lines 0 comments Download
M sync/syncable/entry_kernel.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M sync/syncable/mutable_entry.h View 1 chunk +3 lines, -0 lines 0 comments Download
M sync/syncable/mutable_entry.cc View 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
maniscalco
Pavel, would you please review this change? As I mentioned earlier today, I want to ...
6 years, 8 months ago (2014-04-22 19:49:55 UTC) #1
pavely
https://codereview.chromium.org/247983002/diff/60001/components/sync_driver/generic_change_processor.cc File components/sync_driver/generic_change_processor.cc (right): https://codereview.chromium.org/247983002/diff/60001/components/sync_driver/generic_change_processor.cc#newcode344 components/sync_driver/generic_change_processor.cc:344: syncer::ModelType type, nit: Indentation is off. https://codereview.chromium.org/247983002/diff/60001/sync/syncable/directory.cc File sync/syncable/directory.cc ...
6 years, 7 months ago (2014-04-28 23:26:27 UTC) #2
maniscalco
Thanks for the feedback! All applied. RFAL. https://codereview.chromium.org/247983002/diff/60001/components/sync_driver/generic_change_processor.cc File components/sync_driver/generic_change_processor.cc (right): https://codereview.chromium.org/247983002/diff/60001/components/sync_driver/generic_change_processor.cc#newcode344 components/sync_driver/generic_change_processor.cc:344: syncer::ModelType type, ...
6 years, 7 months ago (2014-04-29 20:53:21 UTC) #3
pavely
One comment, otherwise lgtm. https://codereview.chromium.org/247983002/diff/140001/sync/syncable/DEPS File sync/syncable/DEPS (right): https://codereview.chromium.org/247983002/diff/140001/sync/syncable/DEPS#newcode6 sync/syncable/DEPS:6: "+sync/internal_api/public", Could you take a ...
6 years, 7 months ago (2014-04-30 20:22:11 UTC) #4
maniscalco
Thanks for the feedback. RFAL! https://codereview.chromium.org/247983002/diff/140001/sync/syncable/DEPS File sync/syncable/DEPS (right): https://codereview.chromium.org/247983002/diff/140001/sync/syncable/DEPS#newcode6 sync/syncable/DEPS:6: "+sync/internal_api/public", On 2014/04/30 20:22:12, ...
6 years, 7 months ago (2014-05-01 00:34:15 UTC) #5
tim (not reviewing)
LGTM
6 years, 7 months ago (2014-05-01 18:42:13 UTC) #6
maniscalco
The CQ bit was checked by maniscalco@chromium.org
6 years, 7 months ago (2014-05-01 18:44:37 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/maniscalco@chromium.org/247983002/170001
6 years, 7 months ago (2014-05-01 18:44:55 UTC) #8
commit-bot: I haz the power
Change committed as 267617
6 years, 7 months ago (2014-05-01 20:25:12 UTC) #9
maniscalco
6 years, 7 months ago (2014-05-01 21:58:53 UTC) #10
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/265853004/ by maniscalco@chromium.org.

The reason for reverting is: Looks like this may have introduced a memory leak:

http://build.chromium.org/p/chromium.memory.fyi/builders/Linux%20Tests%20%28v...

Reverting.  Will investigate and reland when appropriate..

Powered by Google App Engine
This is Rietveld 408576698