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

Issue 10386226: gdata: Add requestDirectoryRefresh to file_browser_private. (Closed)

Created:
8 years, 7 months ago by satorux1
Modified:
8 years, 7 months ago
CC:
chromium-reviews, mihaip-chromium-reviews_chromium.org, nkostylev+watch_chromium.org, achuith+watch_chromium.org, Aaron Boodman, rginda+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

gdata: Add requestDirectoryRefresh to file_browser_private. This is a reland of r138055 with a fix for DCHECK failures. The new API is used to fetch the metadata of files in a particular directory. More specifically, the new API is used to fix the stale thumbnail URL issue. BUG=127697 TEST=added a unit test. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=138057

Patch Set 1 #

Total comments: 12

Patch Set 2 : address comments #

Patch Set 3 : add comments #

Patch Set 4 : fix dcheck failures #

Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -2 lines) Patch
M chrome/browser/chromeos/extensions/file_browser_private_api.h View 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/extensions/file_browser_private_api.cc View 1 1 chunk +16 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_file_system.h View 3 chunks +22 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_file_system.cc View 1 2 3 1 chunk +104 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_files.h View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/chromeos/gdata/gdata_files.cc View 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/chromeos/gdata/mock_gdata_file_system.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_function_registry.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/file_browser_private.json View 1 2 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
satorux1
asargent: chrome/common/extensions/api/file_browser_private.json tbarzic: everything else
8 years, 7 months ago (2012-05-18 22:21:30 UTC) #1
tbarzic
http://codereview.chromium.org/10386226/diff/1/chrome/browser/chromeos/extensions/file_browser_private_api.cc File chrome/browser/chromeos/extensions/file_browser_private_api.cc (right): http://codereview.chromium.org/10386226/diff/1/chrome/browser/chromeos/extensions/file_browser_private_api.cc#newcode2133 chrome/browser/chromeos/extensions/file_browser_private_api.cc:2133: std::string file_url_as_string; what if the file is under /gdata/.search/foo/file. ...
8 years, 7 months ago (2012-05-18 22:51:12 UTC) #2
tbarzic
http://codereview.chromium.org/10386226/diff/1/chrome/browser/chromeos/extensions/file_browser_private_api.cc File chrome/browser/chromeos/extensions/file_browser_private_api.cc (right): http://codereview.chromium.org/10386226/diff/1/chrome/browser/chromeos/extensions/file_browser_private_api.cc#newcode2133 chrome/browser/chromeos/extensions/file_browser_private_api.cc:2133: std::string file_url_as_string; On 2012/05/18 22:51:12, tbarzic wrote: > what ...
8 years, 7 months ago (2012-05-18 22:56:12 UTC) #3
asargent_no_longer_on_chrome
file_browser_private.json LGTM as-is, but with a question for clarification about the comment and possible alternative ...
8 years, 7 months ago (2012-05-18 23:22:34 UTC) #4
satorux1
http://codereview.chromium.org/10386226/diff/1/chrome/browser/chromeos/extensions/file_browser_private_api.cc File chrome/browser/chromeos/extensions/file_browser_private_api.cc (right): http://codereview.chromium.org/10386226/diff/1/chrome/browser/chromeos/extensions/file_browser_private_api.cc#newcode2133 chrome/browser/chromeos/extensions/file_browser_private_api.cc:2133: std::string file_url_as_string; On 2012/05/18 22:56:13, tbarzic wrote: > On ...
8 years, 7 months ago (2012-05-18 23:42:18 UTC) #5
satorux1
http://codereview.chromium.org/10386226/diff/1/chrome/common/extensions/api/file_browser_private.json File chrome/common/extensions/api/file_browser_private.json (right): http://codereview.chromium.org/10386226/diff/1/chrome/common/extensions/api/file_browser_private.json#newcode938 chrome/common/extensions/api/file_browser_private.json:938: "description": "Requests a refresh of a directory. Used to ...
8 years, 7 months ago (2012-05-19 00:09:19 UTC) #6
tbarzic
8 years, 7 months ago (2012-05-19 00:21:11 UTC) #7
On 2012/05/19 00:09:19, satorux1 wrote:
>
http://codereview.chromium.org/10386226/diff/1/chrome/common/extensions/api/f...
> File chrome/common/extensions/api/file_browser_private.json (right):
> 
>
http://codereview.chromium.org/10386226/diff/1/chrome/common/extensions/api/f...
> chrome/common/extensions/api/file_browser_private.json:938: "description":
> "Requests a refresh of a directory. Used to get the latest metadata of files
in
> a particular directory. Upon completion, onFileChanged event is raised.",
> On 2012/05/18 23:42:19, satorux1 wrote:
> > On 2012/05/18 23:22:34, Antony Sargent wrote:
> > > Does onFileChanged fire even if the item at |fileURL| actually didn't
> change?
> > > Also, since this is a directory, should the caller expect to potentially
see
> > > onFileChanged fire for any of the files within that directory and its
> > > subdirectories? If so will those fire before or after the onFileChanged
for
> > the
> > > directory itself?
> > > BTW, if you're really just interested in giving callers a way to know when
> > > requestDirectoryRefresh has finished some async work in the browser
process,
> > you
> > > can declare this to have a no-parameter callback and make its c++
> > implementation
> > > in the browser process inherit from AsyncExtensionFunction and wait to
call
> > > SendResponse once the refresh is complete. 
> > > 
> > > Then callers in js can do:
> > > 
> > > chrome.fileBrowserPrivate.requestDirectoryRefresh(
> > >     myurl, function() {
> > >   console.log("directory refresh complete!");
> > > });
> > > 
> > 
> > Thank you for the suggestion. I thought that notifying the completion via
the
> > existing onFileChanged event was simpler, but now I think it's rather dirty.
> I'm
> > going to rework the patch and add ad no-parameter callback.
> 
> I played with the new idea, but I changed my mind again. If the contents in
the
> directory are changed, it's natural to raise onFileChanged() event against the
> target directory. If so, notifying the completion via the non-parameter
callback
> is redundant.
> 
> So I kept the API as-is, but added more comments about the semantics.

lgtm

Powered by Google App Engine
This is Rietveld 408576698