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

Issue 11293247: Make DriveFeedProcessor asynchronous. (Closed)

Created:
8 years, 1 month ago by achuithb
Modified:
8 years, 1 month ago
Reviewers:
mtomasz, satorux1, hashimoto
CC:
chromium-reviews, achuith+watch_chromium.org, oshima+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Make DriveFeedProcessor asynchronous. DriveResourceMetadata: * Add RefreshEntryProto, which will eventually replace RefreshFile. It handles update of metadata, change of parents, and both files and directories. * Introduce AddEntryToParent which adds a DriveEntryProto to the tree. It calls AddEntryToDirectoryInternal which contains common code for AddEntryToParent and AddEntryToDirectory. * Both AddEntryToParent and RefreshEntryProto use GetParent, a helper to determine the parent. * GetChildDirectories recursively gets the list of all children directory paths. * unit tests for these functions. * update unit tests to remove dependence on drive_files.h DriveFeedProcessor: * ApplyEntryProto calls DriveResourceMetadata::GetEntryInfoByResourceId. * ContinueApplyEntryProto calls RemoveEntryFromParent for deleted entries, RefreshEntryProto for existing entries, and AddEntryToParent for new entries. * RefreshEntryProto calls DriveResourceMetadata::RefreshEntryProto. * NotifyForRefreshEntryProto updates changed_dirs_ with the list of affected directories to be notified. * AddEntryToParent calls DriveResourceMetadata::AddEntryToParent. * NotifyForAddEntryToParent updates changed_dirs_ with affected directories to be notified. * RemoveEntryFromParent first fetches all child directories that need to be notified. * OnGetChildrenForRemove calls DriveResourceMetadata::RemoveEntryFromParent. * NotifyForRemoveEntryFromParent updates changed_dirs_ with affected directories to be notified. A number of functions are now unused. They have been marked with TODOs since this patch is rather large. BUG=137374 TEST=unit tests. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=168653

Patch Set 1 #

Patch Set 2 : indentation #

Total comments: 2

Patch Set 3 : unittests and satorux feedback #

Total comments: 14

Patch Set 4 : hashimoto feedback #

Patch Set 5 : remove drive_files.h from unittest #

Total comments: 8

Patch Set 6 : hashimoto feedback #

Patch Set 7 : minor rename #

Patch Set 8 : satorux feedback #

Total comments: 14

Patch Set 9 : rebase #

Patch Set 10 : merge conflicts + feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+665 lines, -156 lines) Patch
M chrome/browser/chromeos/drive/drive_feed_processor.h View 1 2 3 4 5 6 7 8 1 chunk +53 lines, -10 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_feed_processor.cc View 1 2 3 4 5 6 7 8 9 6 chunks +159 lines, -39 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_resource_metadata.h View 1 2 3 4 5 6 7 8 9 5 chunks +38 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_resource_metadata.cc View 1 2 3 4 5 6 7 8 9 5 chunks +95 lines, -37 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_resource_metadata_unittest.cc View 1 2 3 4 5 6 7 8 9 17 chunks +320 lines, -64 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
achuithb
Satoru-san, I will start working on unit tests next, but the code is ready for ...
8 years, 1 month ago (2012-11-13 12:35:40 UTC) #1
satorux1
Took a quick look. The change looks good. I'll take a closer look later. http://codereview.chromium.org/11293247/diff/8/chrome/browser/chromeos/drive/drive_resource_metadata.h ...
8 years, 1 month ago (2012-11-13 22:56:45 UTC) #2
achuithb
Added unit tests as well. http://codereview.chromium.org/11293247/diff/8/chrome/browser/chromeos/drive/drive_resource_metadata.h File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): http://codereview.chromium.org/11293247/diff/8/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode264 chrome/browser/chromeos/drive/drive_resource_metadata.h:264: // Returns root if ...
8 years, 1 month ago (2012-11-14 01:01:35 UTC) #3
satorux1
mtomasz is now ooo. adding hashimoto@ for extra eyes.
8 years, 1 month ago (2012-11-14 04:21:03 UTC) #4
achuithb
On 2012/11/14 04:21:03, satorux1 wrote: > mtomasz is now ooo. adding hashimoto@ for extra eyes. ...
8 years, 1 month ago (2012-11-14 04:23:16 UTC) #5
hashimoto
http://codereview.chromium.org/11293247/diff/9/chrome/browser/chromeos/drive/drive_feed_processor.h File chrome/browser/chromeos/drive/drive_feed_processor.h (right): http://codereview.chromium.org/11293247/diff/9/chrome/browser/chromeos/drive/drive_feed_processor.h#newcode98 chrome/browser/chromeos/drive/drive_feed_processor.h:98: void AddEntryToParent(const DriveEntryProto& entry_proto); Our coding style discourages function ...
8 years, 1 month ago (2012-11-14 10:15:56 UTC) #6
achuithb
Thanks for the comments. PTAL! http://codereview.chromium.org/11293247/diff/9/chrome/browser/chromeos/drive/drive_feed_processor.h File chrome/browser/chromeos/drive/drive_feed_processor.h (right): http://codereview.chromium.org/11293247/diff/9/chrome/browser/chromeos/drive/drive_feed_processor.h#newcode98 chrome/browser/chromeos/drive/drive_feed_processor.h:98: void AddEntryToParent(const DriveEntryProto& entry_proto); ...
8 years, 1 month ago (2012-11-14 11:11:29 UTC) #7
satorux1
http://codereview.chromium.org/11293247/diff/6005/chrome/browser/chromeos/drive/drive_feed_processor.cc File chrome/browser/chromeos/drive/drive_feed_processor.cc (right): http://codereview.chromium.org/11293247/diff/6005/chrome/browser/chromeos/drive/drive_feed_processor.cc#newcode311 chrome/browser/chromeos/drive/drive_feed_processor.cc:311: if (dir) nit: please add back {}. The body ...
8 years, 1 month ago (2012-11-15 01:49:10 UTC) #8
hashimoto
http://codereview.chromium.org/11293247/diff/9/chrome/browser/chromeos/drive/drive_resource_metadata.h File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): http://codereview.chromium.org/11293247/diff/9/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode259 chrome/browser/chromeos/drive/drive_resource_metadata.h:259: void GetChangedDirectories( On 2012/11/14 11:11:29, achuith.bhandarkar wrote: > On ...
8 years, 1 month ago (2012-11-15 04:10:41 UTC) #9
achuithb
http://codereview.chromium.org/11293247/diff/9/chrome/browser/chromeos/drive/drive_resource_metadata.h File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): http://codereview.chromium.org/11293247/diff/9/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode259 chrome/browser/chromeos/drive/drive_resource_metadata.h:259: void GetChangedDirectories( On 2012/11/15 04:10:41, hashimoto wrote: > On ...
8 years, 1 month ago (2012-11-15 23:39:53 UTC) #10
achuithb
http://codereview.chromium.org/11293247/diff/6005/chrome/browser/chromeos/drive/drive_file_system_unittest.cc File chrome/browser/chromeos/drive/drive_file_system_unittest.cc (right): http://codereview.chromium.org/11293247/diff/6005/chrome/browser/chromeos/drive/drive_file_system_unittest.cc#newcode1047 chrome/browser/chromeos/drive/drive_file_system_unittest.cc:1047: .Times(1); On 2012/11/15 01:49:10, satorux1 wrote: > I'm confused. ...
8 years, 1 month ago (2012-11-15 23:57:08 UTC) #11
achuithb
I need to re-order the functions in the cc file to match the order in ...
8 years, 1 month ago (2012-11-15 23:57:50 UTC) #12
satorux1
http://codereview.chromium.org/11293247/diff/6005/chrome/browser/chromeos/drive/drive_file_system_unittest.cc File chrome/browser/chromeos/drive/drive_file_system_unittest.cc (right): http://codereview.chromium.org/11293247/diff/6005/chrome/browser/chromeos/drive/drive_file_system_unittest.cc#newcode1047 chrome/browser/chromeos/drive/drive_file_system_unittest.cc:1047: .Times(1); On 2012/11/15 23:57:08, achuith.bhandarkar wrote: > On 2012/11/15 ...
8 years, 1 month ago (2012-11-16 06:57:48 UTC) #13
achuithb
Changes to drive_filesystem_unittest.cc have been reverted. For Refresh, we don't notify children of directories as ...
8 years, 1 month ago (2012-11-16 22:55:56 UTC) #14
achuithb
Changes to drive_filesystem_unittest.cc have been reverted. For Refresh, we don't notify children of directories as ...
8 years, 1 month ago (2012-11-16 22:55:56 UTC) #15
satorux1
LGTM with nits http://codereview.chromium.org/11293247/diff/28002/chrome/browser/chromeos/drive/drive_feed_processor.cc File chrome/browser/chromeos/drive/drive_feed_processor.cc (right): http://codereview.chromium.org/11293247/diff/28002/chrome/browser/chromeos/drive/drive_feed_processor.cc#newcode202 chrome/browser/chromeos/drive/drive_feed_processor.cc:202: if (!entry_proto->has_file_specific_info()) { The following would ...
8 years, 1 month ago (2012-11-19 01:24:24 UTC) #16
hashimoto
lgtm with nits http://codereview.chromium.org/11293247/diff/28002/chrome/browser/chromeos/drive/drive_resource_metadata.h File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): http://codereview.chromium.org/11293247/diff/28002/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode95 chrome/browser/chromeos/drive/drive_resource_metadata.h:95: ChangedDirectoriesCallback; Please rename this.
8 years, 1 month ago (2012-11-19 10:18:02 UTC) #17
achuithb
Thanks for the reviews, Satoru-san and Ryo-san! http://codereview.chromium.org/11293247/diff/28002/chrome/browser/chromeos/drive/drive_resource_metadata.h File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): http://codereview.chromium.org/11293247/diff/28002/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode95 chrome/browser/chromeos/drive/drive_resource_metadata.h:95: ChangedDirectoriesCallback; On ...
8 years, 1 month ago (2012-11-19 21:49:32 UTC) #18
commit-bot: I haz the power
8 years, 1 month ago (2012-11-19 21:56:35 UTC) #19

Powered by Google App Engine
This is Rietveld 408576698