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

Issue 11227020: Set root resource ID upon full feed update. (Closed)

Created:
8 years, 2 months ago by kochi
Modified:
8 years, 1 month ago
Reviewers:
achuithb, satorux1
CC:
chromium-reviews, oshima+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org, achuithb, Haruki Sato
Visibility:
Public.

Description

Set root resource ID upon full feed update. We used to set the resource ID at DriveResourceMetadata's constructor as for WAPI the resource ID for root is a fixed string, but for Drive API it is not fixed and was set when About resource is obtained. This caused a trouble for maintaining the code and this CL is trying to consolidate setting root resource ID at one place. Although for Drive API 'root' can be used for a convenient alias for queries, Drive API usually returns a reference to root directory (e.g. reference to parent folder) as its real root directory resource ID rather than 'root' alias, therefore we don't use it here. BUG=152230, 152288, 157314 TEST=compiles, pass all existing tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=164876 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=165219 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=165303

Patch Set 1 #

Total comments: 2

Patch Set 2 : Move kDriveRootDerectoryResourceId from .h to .cc #

Patch Set 3 : rebase #

Patch Set 4 : more complete change. #

Patch Set 5 : Add a comment. #

Total comments: 6

Patch Set 6 : move constant back to .h #

Patch Set 7 : Remove |saved_root_resource_id_| and use local variable for the purpose. #

Patch Set 8 : make root_resource_id() work when root_ is not initialized. #

Total comments: 4

Patch Set 9 : Remove const. #

Patch Set 10 : Add a TODO. #

Patch Set 11 : Change InitializeRootEntry to SetRootResourceId #

Patch Set 12 : Introduce SetRootResourceId(), fix failing unittests. #

Patch Set 13 : rebase #

Patch Set 14 : undo minor comment fix. #

Total comments: 7

Patch Set 15 : Remove unintended change (chrome_switches.h) #

Patch Set 16 : Fix for comments #

Total comments: 2

Patch Set 17 : Fix for comments. #

Patch Set 18 : rebase. #

Total comments: 4

Patch Set 19 : Fix for comments. #

Patch Set 20 : rebase ToT #

Patch Set 21 : Change DCHECK to CHECK for setting resource ID multiple times. #

Patch Set 22 : revert the previous #

Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -28 lines) Patch
M chrome/browser/chromeos/drive/drive_feed_loader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_feed_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +20 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_file_system_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +11 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_resource_metadata.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_resource_metadata.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 8 chunks +18 lines, -10 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_resource_metadata_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7 chunks +15 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/drive/drive_test_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 34 (0 generated)
kochi
Hi Satoru, Could you review this? Thanks,
8 years, 2 months ago (2012-10-22 07:58:05 UTC) #1
satorux1
LGTM
8 years, 2 months ago (2012-10-22 08:03:30 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kochi@chromium.org/11227020/1
8 years, 2 months ago (2012-10-22 08:19:20 UTC) #3
achuithb
https://chromiumcodereview.appspot.com/11227020/diff/1/chrome/browser/chromeos/drive/drive_resource_metadata.h File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): https://chromiumcodereview.appspot.com/11227020/diff/1/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode64 chrome/browser/chromeos/drive/drive_resource_metadata.h:64: const char kDriveRootDirectoryResourceId[] = "folder:root"; We should probably move ...
8 years, 2 months ago (2012-10-22 09:27:56 UTC) #4
kochi
I found that InitFromDB()'s usage of root resource ID is problematic with the old change ...
8 years, 2 months ago (2012-10-23 06:08:46 UTC) #5
satorux1
http://codereview.chromium.org/11227020/diff/2009/chrome/browser/chromeos/drive/drive_file_system_unittest.cc File chrome/browser/chromeos/drive/drive_file_system_unittest.cc (right): http://codereview.chromium.org/11227020/diff/2009/chrome/browser/chromeos/drive/drive_file_system_unittest.cc#newcode54 chrome/browser/chromeos/drive/drive_file_system_unittest.cc:54: const char kWAPIRootDirectoryResourceId[] = "folder:root"; I think it's better ...
8 years, 2 months ago (2012-10-23 06:54:50 UTC) #6
kochi
Thanks for the review! http://codereview.chromium.org/11227020/diff/2009/chrome/browser/chromeos/drive/drive_file_system_unittest.cc File chrome/browser/chromeos/drive/drive_file_system_unittest.cc (right): http://codereview.chromium.org/11227020/diff/2009/chrome/browser/chromeos/drive/drive_file_system_unittest.cc#newcode54 chrome/browser/chromeos/drive/drive_file_system_unittest.cc:54: const char kWAPIRootDirectoryResourceId[] = "folder:root"; ...
8 years, 2 months ago (2012-10-23 07:44:35 UTC) #7
satorux1
http://codereview.chromium.org/11227020/diff/12008/chrome/browser/chromeos/drive/drive_resource_metadata.h File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): http://codereview.chromium.org/11227020/diff/12008/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode269 chrome/browser/chromeos/drive/drive_resource_metadata.h:269: const std::string root_resource_id() const; Drop the first const. Besides, ...
8 years, 2 months ago (2012-10-23 08:06:26 UTC) #8
kochi
http://codereview.chromium.org/11227020/diff/12008/chrome/browser/chromeos/drive/drive_resource_metadata.h File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): http://codereview.chromium.org/11227020/diff/12008/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode269 chrome/browser/chromeos/drive/drive_resource_metadata.h:269: const std::string root_resource_id() const; On 2012/10/23 08:06:26, satorux1 wrote: ...
8 years, 2 months ago (2012-10-23 08:21:21 UTC) #9
satorux1
On 2012/10/23 08:21:21, Takayoshi Kochi wrote: > http://codereview.chromium.org/11227020/diff/12008/chrome/browser/chromeos/drive/drive_resource_metadata.h > File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): > > http://codereview.chromium.org/11227020/diff/12008/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode269 ...
8 years, 2 months ago (2012-10-23 08:28:28 UTC) #10
satorux1
I rethought about the root ID business, and am becoming to think that the current ...
8 years, 2 months ago (2012-10-23 09:04:41 UTC) #11
kochi
On 2012/10/23 09:04:41, satorux1 wrote: > I rethought about the root ID business, and am ...
8 years, 2 months ago (2012-10-23 16:14:00 UTC) #12
satorux1
On 2012/10/23 16:14:00, Takayoshi Kochi wrote: > On 2012/10/23 09:04:41, satorux1 wrote: > > I ...
8 years, 2 months ago (2012-10-24 01:30:25 UTC) #13
kochi
Revised the patch. Could you take another look?
8 years, 1 month ago (2012-10-26 03:44:17 UTC) #14
satorux1
http://codereview.chromium.org/11227020/diff/23001/chrome/browser/chromeos/drive/drive_feed_loader.cc File chrome/browser/chromeos/drive/drive_feed_loader.cc (right): http://codereview.chromium.org/11227020/diff/23001/chrome/browser/chromeos/drive/drive_feed_loader.cc#newcode901 chrome/browser/chromeos/drive/drive_feed_loader.cc:901: if (start_changestamp == 0) { { // full fetch ...
8 years, 1 month ago (2012-10-26 06:14:36 UTC) #15
kochi
Thanks for comments. The change for addressing comments for ClearRoot() revealed that I should have ...
8 years, 1 month ago (2012-10-26 07:35:42 UTC) #16
satorux1
http://codereview.chromium.org/11227020/diff/23001/chrome/browser/chromeos/drive/drive_resource_metadata.cc File chrome/browser/chromeos/drive/drive_resource_metadata.cc (right): http://codereview.chromium.org/11227020/diff/23001/chrome/browser/chromeos/drive/drive_resource_metadata.cc#newcode246 chrome/browser/chromeos/drive/drive_resource_metadata.cc:246: if (!root_->resource_id().empty()) { On 2012/10/26 07:35:42, Takayoshi Kochi wrote: ...
8 years, 1 month ago (2012-10-26 07:52:43 UTC) #17
kochi
ClearRoot() is also modified. https://chromiumcodereview.appspot.com/11227020/diff/38010/chrome/browser/chromeos/drive/drive_resource_metadata.h File chrome/browser/chromeos/drive/drive_resource_metadata.h (right): https://chromiumcodereview.appspot.com/11227020/diff/38010/chrome/browser/chromeos/drive/drive_resource_metadata.h#newcode172 chrome/browser/chromeos/drive/drive_resource_metadata.h:172: void SetRootResourceId(const std::string& id); On ...
8 years, 1 month ago (2012-10-26 09:01:23 UTC) #18
kochi
On 2012/10/26 09:01:23, Takayoshi Kochi wrote: > ClearRoot() is also modified. > > https://chromiumcodereview.appspot.com/11227020/diff/38010/chrome/browser/chromeos/drive/drive_resource_metadata.h > ...
8 years, 1 month ago (2012-10-26 09:24:58 UTC) #19
satorux1
http://codereview.chromium.org/11227020/diff/48001/chrome/browser/chromeos/drive/drive_feed_processor.cc File chrome/browser/chromeos/drive/drive_feed_processor.cc (right): http://codereview.chromium.org/11227020/diff/48001/chrome/browser/chromeos/drive/drive_feed_processor.cc#newcode97 chrome/browser/chromeos/drive/drive_feed_processor.cc:97: orphaned_resources->InitializeRootEntry("orphan"); This code should be unnecessary. orphaned resource stuff ...
8 years, 1 month ago (2012-10-29 05:28:35 UTC) #20
kochi
Fixed for comments. This still fails unit_tests for me. Please hold on review. https://chromiumcodereview.appspot.com/11227020/diff/48001/chrome/browser/chromeos/drive/drive_feed_processor.cc File ...
8 years, 1 month ago (2012-10-29 05:52:39 UTC) #21
satorux1
LGTM!
8 years, 1 month ago (2012-10-29 06:06:37 UTC) #22
kochi
On 2012/10/29 06:06:37, satorux1 wrote: > LGTM! Thanks for the review! The unit_test failure was ...
8 years, 1 month ago (2012-10-29 10:28:44 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kochi@chromium.org/11227020/50002
8 years, 1 month ago (2012-10-30 05:59:59 UTC) #24
commit-bot: I haz the power
Change committed as 164876
8 years, 1 month ago (2012-10-30 08:35:45 UTC) #25
kochi
On 2012/10/30 08:35:45, I haz the power (commit-bot) wrote: > Change committed as 164876 This ...
8 years, 1 month ago (2012-10-30 09:22:32 UTC) #26
kochi
On 2012/10/30 09:22:32, Takayoshi Kochi wrote: > On 2012/10/30 08:35:45, I haz the power (commit-bot) ...
8 years, 1 month ago (2012-10-31 09:12:30 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kochi@chromium.org/11227020/50002
8 years, 1 month ago (2012-10-31 17:02:02 UTC) #28
commit-bot: I haz the power
Change committed as 165219
8 years, 1 month ago (2012-10-31 20:47:54 UTC) #29
kochi
On 2012/10/31 20:47:54, I haz the power (commit-bot) wrote: > Change committed as 165219 This ...
8 years, 1 month ago (2012-11-01 04:09:20 UTC) #30
kochi
On 2012/11/01 04:09:20, Takayoshi Kochi wrote: > On 2012/10/31 20:47:54, I haz the power (commit-bot) ...
8 years, 1 month ago (2012-11-01 06:45:14 UTC) #31
phoglund_chromium
I'm sorry, but the ChromeOS tests still flake (as you can see in http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/12006/steps/unit_tests/logs/stdio), and ...
8 years, 1 month ago (2012-11-05 13:44:07 UTC) #32
kochi
On 2012/11/05 13:44:07, phoglund wrote: > I'm sorry, but the ChromeOS tests still flake (as ...
8 years, 1 month ago (2012-11-06 02:20:36 UTC) #33
kochi
8 years, 1 month ago (2012-11-06 06:35:58 UTC) #34
On 2012/11/06 02:20:36, Takayoshi Kochi wrote:
> On 2012/11/05 13:44:07, phoglund wrote:
> > I'm sorry, but the ChromeOS tests still flake (as you can see in
> >
>
http://build.chromium.org/p/chromium.chromiumos/builders/Linux%252520Chromium...),
> > and it's the DCHECK you added which is blowing up.  You will have to fix
> either
> > the code or the tests here. 
> > 
> > It's possible that the old version of code ignored an empty root resource id
> > (for bad or worse) and that there's some race condition that causes the code
> to
> > end up in that bad state. Either way, I'll roll this back for now. I
> understand
> > it's frustrating since I can see you have committed this a few times, but we
> > need to solve the problem with the flaky tests. It's very likely this race
> > condition can happen in the production code too and in that case something
bad
> > will likely happen.
> 
> OK, I'll investigate and try again.

FYI filed a bug for this
http://code.google.com/p/chromium/issues/detail?id=159562

Powered by Google App Engine
This is Rietveld 408576698