gdata: Fix "save as pdf" to work on Google Drive in ChromeOS.
BUG=137411
TEST=unit_tests --gtest_filter='*GDataFileWritingTest*'
TEST=press Ctrl+P and then the save button, choose Google Drive, and verify it is correctly saved.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=149799
8 years, 4 months ago
(2012-07-28 00:06:10 UTC)
#3
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
File chrome/browser/chromeos/gdata/gdata_file_system_interface.h (right):
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
chrome/browser/chromeos/gdata/gdata_file_system_interface.h:186: const
OpenFileCallback& callback) = 0;
On 2012/07/27 22:56:29, satorux1 wrote:
> We want to minimize functions in GDataFileSystem. Can you implement this
outside
> of GDataFileSystem?
I'll think about it. Do you have any advice where it would be the better place
to put it?
I currently chose to place it inside GDataFileSystem for safely getting (or not
getting, when already destructed) pointer to it for calling CloseFile().
>
> Besides, please write a unit test for the new function.
8 years, 4 months ago
(2012-07-28 00:44:07 UTC)
#4
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
File chrome/browser/chromeos/gdata/gdata_file_system_interface.h (right):
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
chrome/browser/chromeos/gdata/gdata_file_system_interface.h:186: const
OpenFileCallback& callback) = 0;
On 2012/07/28 00:06:10, kinaba wrote:
> On 2012/07/27 22:56:29, satorux1 wrote:
> > We want to minimize functions in GDataFileSystem. Can you implement this
> outside
> > of GDataFileSystem?
>
> I'll think about it. Do you have any advice where it would be the better place
> to put it?
> I currently chose to place it inside GDataFileSystem for safely getting (or
not
> getting, when already destructed) pointer to it for calling CloseFile().
I guess we can move this to gdata_util.cc. For CloseFile(), we should probably
check if GDataSystemService::file_system() is non-null before calling it. I'm
not sure if it's feasible, though.
You might also want to make it a class and put into new files. gdata_util.cc is
also getting bigger. :P
>
> >
> > Besides, please write a unit test for the new function.
8 years, 4 months ago
(2012-08-01 13:48:45 UTC)
#5
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
File chrome/browser/chromeos/gdata/gdata_file_system.cc (right):
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
chrome/browser/chromeos/gdata/gdata_file_system.cc:4200: GDataFileError result)
{
On 2012/07/27 22:56:29, satorux1 wrote:
> result -> error
Done.
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
chrome/browser/chromeos/gdata/gdata_file_system.cc:4207: base::Bind(callback,
result, FilePath()));
On 2012/07/27 22:56:29, satorux1 wrote:
> we should just run the callback here.
>
> PostTask should rarely be used. Maybe we should check and fix the existing
> usage. I'll file a bug.
This is not a PostTask to the current thread, it is posting to blocking thread
pool (since |callback| needs to be called on that thread in successful cases,
I'd like to align the failure case to it.)
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
chrome/browser/chromeos/gdata/gdata_file_system.cc:4222: GDataFileError result,
On 2012/07/27 22:56:29, satorux1 wrote:
> error
Done.
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
chrome/browser/chromeos/gdata/gdata_file_system.cc:4228:
content::BrowserThread::GetBlockingPool()->PostTask(
On 2012/07/27 22:56:29, satorux1 wrote:
> ditto
See the reply above.
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
File chrome/browser/chromeos/gdata/gdata_file_system_interface.h (right):
http://codereview.chromium.org/10827068/diff/9001/chrome/browser/chromeos/gda...
chrome/browser/chromeos/gdata/gdata_file_system_interface.h:186: const
OpenFileCallback& callback) = 0;
On 2012/07/28 00:44:07, satorux1 wrote:
> On 2012/07/28 00:06:10, kinaba wrote:
> > On 2012/07/27 22:56:29, satorux1 wrote:
> > > We want to minimize functions in GDataFileSystem. Can you implement this
> > outside
> > > of GDataFileSystem?
> >
> > I'll think about it. Do you have any advice where it would be the better
place
> > to put it?
> > I currently chose to place it inside GDataFileSystem for safely getting (or
> not
> > getting, when already destructed) pointer to it for calling CloseFile().
>
> I guess we can move this to gdata_util.cc. For CloseFile(), we should probably
> check if GDataSystemService::file_system() is non-null before calling it. I'm
> not sure if it's feasible, though.
>
> You might also want to make it a class and put into new files. gdata_util.cc
is
> also getting bigger. :P
>
> >
> > >
> > > Besides, please write a unit test for the new function.
>
Created a separate class (suggestions are highly welcome for
the name of the class!) and made it to be owned by GDataSystemService.
The reason is, we need to call GDataFileSystem::CloseFile() after
|callback| executed its task on FILE thread, during which, not only
GDataFileSystemInterface but also GDataSystemService and Profile might
have gone (if I understand the lifetime of Profile correctly).
I thought the most handy way to detect this destruction is having a
weak_ptr to an instance (in)directly owned by Profile.
Let me know if there's a better approach.
satorux1
http://codereview.chromium.org/10827068/diff/15009/chrome/browser/chromeos/gdata/gdata_file_writing.h File chrome/browser/chromeos/gdata/gdata_file_writing.h (right): http://codereview.chromium.org/10827068/diff/15009/chrome/browser/chromeos/gdata/gdata_file_writing.h#newcode18 chrome/browser/chromeos/gdata/gdata_file_writing.h:18: class GDataFileWriting { The class name looks rather unusual. ...
8 years, 4 months ago
(2012-08-02 01:08:09 UTC)
#6
http://codereview.chromium.org/10827068/diff/6021/chrome/browser/chromeos/gdata/gdata_file_write_helper.cc File chrome/browser/chromeos/gdata/gdata_file_write_helper.cc (right): http://codereview.chromium.org/10827068/diff/6021/chrome/browser/chromeos/gdata/gdata_file_write_helper.cc#newcode41 chrome/browser/chromeos/gdata/gdata_file_write_helper.cc:41: weak_ptr_factory_.GetWeakPtr(), ah, I was wrong. If you are to ...
8 years, 4 months ago
(2012-08-02 06:56:53 UTC)
#8
brettw: I'd just like to ask your owner's stamp for file addition to chrome_{browser,tests}.gypi. abodenha: ...
8 years, 4 months ago
(2012-08-02 09:13:58 UTC)
#13
brettw:
I'd just like to ask your owner's stamp for file addition to
chrome_{browser,tests}.gypi.
abodenha:
Could you review the changes in print_preview_handler.cc?
I admit that it would be ideal if we could implement file
writing to Drive fully transparently, but it requires more efforts.
So I propose the current patch as a practical solution for
the coming M22.
Thanks!
Albert Bodenhamer
print_preview_handler lgtm http://codereview.chromium.org/10827068/diff/10029/chrome/browser/ui/webui/print_preview/print_preview_handler.cc File chrome/browser/ui/webui/print_preview/print_preview_handler.cc (right): http://codereview.chromium.org/10827068/diff/10029/chrome/browser/ui/webui/print_preview/print_preview_handler.cc#newcode62 chrome/browser/ui/webui/print_preview/print_preview_handler.cc:62: #ifdef OS_CHROMEOS Could you create a bug ...
8 years, 4 months ago
(2012-08-02 16:20:59 UTC)
#14
still lgtm On Thu, Aug 2, 2012 at 10:19 PM, <kinaba@chromium.org> wrote: > Done. Thank ...
8 years, 4 months ago
(2012-08-05 02:54:53 UTC)
#17
still lgtm
On Thu, Aug 2, 2012 at 10:19 PM, <kinaba@chromium.org> wrote:
> Done. Thank you for reviewing.
>
>
>
> http://codereview.chromium.**org/10827068/diff/10029/**
>
chrome/browser/ui/webui/print_**preview/print_preview_handler.**cc<http://codereview.chromium.org/10827068/diff/10029/chrome/browser/ui/webui/print_preview/print_preview_handler.cc>
> File chrome/browser/ui/webui/print_**preview/print_preview_handler.**cc
> (right):
>
> http://codereview.chromium.**org/10827068/diff/10029/**
> chrome/browser/ui/webui/print_**preview/print_preview_handler.**
>
cc#newcode62<http://codereview.chromium.org/10827068/diff/10029/chrome/browser/ui/webui/print_preview/print_preview_handler.cc#newcode62>
> chrome/browser/ui/webui/print_**preview/print_preview_handler.**cc:62:
> #ifdef OS_CHROMEOS
> On 2012/08/02 16:20:59, Albert Bodenhamer wrote:
>
>> Could you create a bug to unify/simplify the flow and add a TODO here
>>
> that
>
>> references it?
>>
>
> Done.
>
>
http://codereview.chromium.**org/10827068/<http://codereview.chromium.org/108...
>
--
Albert Bodenhamer | Software Engineer | abodenha@chromium.<abodenha@google.com>
org
Issue 10827068: gdata: Fix "save as pdf" to work on Google Drive.
(Closed)
Created 8 years, 4 months ago by kinaba
Modified 8 years, 4 months ago
Reviewers: satorux1, Albert Bodenhamer, brettw
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 31