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

Issue 3165062: Deletable file references. (Closed)

Created:
10 years, 4 months ago by michaeln
Modified:
9 years, 7 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, ericu
Visibility:
Public.

Description

Flesh out URLLoader's download_to_file function. * tie the lifetime of the resulting temp file to the lifetime of the URLLoader (the plan is to later extend the lifetime of the temp file to support xhr.responseBlob) * make it work in test_shell * make it work for sync requests * added OnDataDownloaded messages to report progress A related BlobURL loading change. * grab a reference to the blob early on to ensure it's still there when the 'job' is finally started. TEST=manual and deletable_file_reference_unittest.cc BUG=52486 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=60378

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 26

Patch Set 6 : '' #

Total comments: 2

Patch Set 7 : '' #

Total comments: 2

Patch Set 8 : '' #

Total comments: 4

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Total comments: 2

Patch Set 18 : '' #

Patch Set 19 : '' #

Total comments: 1

Patch Set 20 : '' #

Total comments: 23

Patch Set 21 : '' #

Patch Set 22 : '' #

Total comments: 16

Patch Set 23 : '' #

Total comments: 2

Patch Set 24 : '' #

Patch Set 25 : '' #

Patch Set 26 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+464 lines, -116 lines) Patch
M chrome/browser/net/blob_url_request_job_factory.cc View 18 19 20 21 22 23 24 25 2 chunks +15 lines, -5 lines 0 comments Download
M chrome/browser/renderer_host/async_resource_handler.h View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/renderer_host/async_resource_handler.cc View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/redirect_to_file_resource_handler.h View 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +8 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/redirect_to_file_resource_handler.cc View 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 6 chunks +16 lines, -16 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.h View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 4 chunks +24 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.cc View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 10 chunks +48 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host_request_info.h View 18 19 20 21 22 23 24 25 3 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host_request_info.cc View 18 19 20 21 22 23 24 25 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_handler.h View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/sync_resource_handler.cc View 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/render_messages_internal.h View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 4 chunks +15 lines, -12 lines 0 comments Download
M chrome/common/resource_dispatcher.h View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/common/resource_dispatcher.cc View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 9 chunks +74 lines, -75 lines 0 comments Download
A webkit/blob/deletable_file_reference.h View 1 chunk +49 lines, -0 lines 0 comments Download
A webkit/blob/deletable_file_reference.cc View 1 chunk +63 lines, -0 lines 0 comments Download
A webkit/blob/deletable_file_reference_unittest.cc View 23 1 chunk +51 lines, -0 lines 0 comments Download
M webkit/blob/webkit_blob.gypi View 23 24 25 1 chunk +2 lines, -0 lines 0 comments Download
M webkit/glue/weburlloader_impl.cc View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +5 lines, -2 lines 0 comments Download
M webkit/tools/test_shell/simple_resource_loader_bridge.cc View 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 15 chunks +53 lines, -3 lines 0 comments Download
M webkit/tools/test_shell/test_shell.gypi View 23 24 25 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 46 (0 generated)
michaeln
This isn't really ready for review yet, but i wanted to send it out so ...
10 years, 3 months ago (2010-09-01 22:26:08 UTC) #1
dumi
LGTM, in general. http://codereview.chromium.org/3165062/diff/16001/14005 File base/deletable_file_reference.cc (right): http://codereview.chromium.org/3165062/diff/16001/14005#newcode42 base/deletable_file_reference.cc:42: DCHECK(!GetReference(path_)); could be replaced with DCHECK(map()->find(path) ...
10 years, 3 months ago (2010-09-02 20:15:20 UTC) #2
jianli
Some comments. http://codereview.chromium.org/3165062/diff/16001/14006 File base/deletable_file_reference.h (right): http://codereview.chromium.org/3165062/diff/16001/14006#newcode21 base/deletable_file_reference.h:21: // for this patch exists returns NULL. ...
10 years, 3 months ago (2010-09-02 20:46:21 UTC) #3
michaeln
thnx for looking http://codereview.chromium.org/3165062/diff/16001/14006 File base/deletable_file_reference.h (right): http://codereview.chromium.org/3165062/diff/16001/14006#newcode16 base/deletable_file_reference.h:16: // A refcounted wrapper around a ...
10 years, 3 months ago (2010-09-02 21:39:39 UTC) #4
michaeln
http://codereview.chromium.org/3165062/diff/16001/14005 File base/deletable_file_reference.cc (right): http://codereview.chromium.org/3165062/diff/16001/14005#newcode49 base/deletable_file_reference.cc:49: if (file_thread_) On 2010/09/02 20:15:20, dumi wrote: > On ...
10 years, 3 months ago (2010-09-04 00:04:25 UTC) #5
michaeln
http://codereview.chromium.org/3165062/diff/30001/31009 File webkit/glue/plugins/pepper_file_ref.cc (right): http://codereview.chromium.org/3165062/diff/30001/31009#newcode136 webkit/glue/plugins/pepper_file_ref.cc:136: // TODO(michaeln): ipc to maybe addRef the remote DeleteableFileReference ...
10 years, 3 months ago (2010-09-07 22:17:22 UTC) #6
dumi
On Tue, Sep 7, 2010 at 3:17 PM, <michaeln@chromium.org> wrote: > > http://codereview.chromium.org/3165062/diff/30001/31009 > File ...
10 years, 3 months ago (2010-09-07 23:24:03 UTC) #7
michaeln
> > 3. Implement this in the plugin case using chrome's Blob handling > > ...
10 years, 3 months ago (2010-09-07 23:46:08 UTC) #8
michaeln
http://codereview.chromium.org/3165062/diff/22002/39009 File webkit/glue/plugins/pepper_file_ref.cc (right): http://codereview.chromium.org/3165062/diff/22002/39009#newcode150 webkit/glue/plugins/pepper_file_ref.cc:150: registered_blob_id_ = GURL(); // how do we generate guid's ...
10 years, 3 months ago (2010-09-07 23:51:37 UTC) #9
dumi
i don't think we have a ID generator. i usually use base/atomic_sequence_num.h for this. On ...
10 years, 3 months ago (2010-09-07 23:55:40 UTC) #10
michaeln
On 2010/09/07 23:55:40, dumi wrote: > i don't think we have a ID generator. i ...
10 years, 3 months ago (2010-09-08 00:00:37 UTC) #11
darin (slow to review)
http://codereview.chromium.org/3165062/diff/22002/39007 File webkit/glue/plugins/pepper_file_io.cc (right): http://codereview.chromium.org/3165062/diff/22002/39007#newcode225 webkit/glue/plugins/pepper_file_io.cc:225: opened_file_ = file_ref; i think you meant to assign ...
10 years, 3 months ago (2010-09-08 00:03:37 UTC) #12
michaeln
On 2010/09/08 00:00:37, michaeln wrote: > On 2010/09/07 23:55:40, dumi wrote: > > i don't ...
10 years, 3 months ago (2010-09-08 00:09:47 UTC) #13
michaeln
> http://codereview.chromium.org/3165062/diff/46001/47009#newcode144 > webkit/glue/plugins/pepper_file_ref.cc:144: if (fs_type_ == > PP_FILESYSTEMTYPE_EXTERNAL) { > this seems like a ...
10 years, 3 months ago (2010-09-08 00:23:01 UTC) #14
darin (slow to review)
On Tue, Sep 7, 2010 at 5:23 PM, <michaeln@chromium.org> wrote: > http://codereview.chromium.org/3165062/diff/46001/47009#newcode144 >> webkit/glue/plugins/pepper_file_ref.cc:144: if ...
10 years, 3 months ago (2010-09-08 05:20:04 UTC) #15
michaeln
> Do you think it will make the WebCore side ugly? > -Darin I still ...
10 years, 3 months ago (2010-09-08 05:38:14 UTC) #16
michaeln
> and have the URLRequest stay valid at least until then at least until the ...
10 years, 3 months ago (2010-09-08 05:53:08 UTC) #17
michaeln
Maybe we could effectively get that ACK w/o altering lifecycles. // browser 0. handler creates ...
10 years, 3 months ago (2010-09-08 06:18:01 UTC) #18
michaeln
Initially, this CL was just a simple DeletableFileReference class . The hope was that that ...
10 years, 3 months ago (2010-09-11 00:05:43 UTC) #19
michaeln
... and make that work in chrome and test_shell
10 years, 3 months ago (2010-09-11 00:07:10 UTC) #20
michaeln
On 2010/09/11 00:05:43, michaeln wrote: > There are two 'customers' for this stuff, pepper and ...
10 years, 3 months ago (2010-09-14 01:31:34 UTC) #21
michaeln
So I've backed up and just implemented the 'download_to_file' semantics for chrome and test_shell where ...
10 years, 3 months ago (2010-09-15 01:52:35 UTC) #22
michaeln
trybots are looking happy with this
10 years, 3 months ago (2010-09-15 03:45:25 UTC) #23
michaeln
please take a look
10 years, 3 months ago (2010-09-16 03:16:21 UTC) #24
jianli
http://codereview.chromium.org/3165062/diff/141001/79006 File base/deletable_file_reference.h (right): http://codereview.chromium.org/3165062/diff/141001/79006#newcode20 base/deletable_file_reference.h:20: // Returns the DeletableFileReference for the given path, if ...
10 years, 3 months ago (2010-09-16 22:05:54 UTC) #25
michaeln
thnx for looking, i'll ping you again when i have a new snapshot http://codereview.chromium.org/3165062/diff/125002/113007 File ...
10 years, 3 months ago (2010-09-16 22:32:33 UTC) #26
michaeln
New snapshot after sync/merging and other changes mentioned below. http://codereview.chromium.org/3165062/diff/141001/79006 File base/deletable_file_reference.h (right): http://codereview.chromium.org/3165062/diff/141001/79006#newcode20 base/deletable_file_reference.h:20: ...
10 years, 3 months ago (2010-09-16 23:48:01 UTC) #27
jianli
LGTM. http://codereview.chromium.org/3165062/diff/79024/146003 File base/deletable_file_reference.cc (right): http://codereview.chromium.org/3165062/diff/79024/146003#newcode34 base/deletable_file_reference.cc:34: DeletableFileReference::GetOrCreate( Can this line be appended to the ...
10 years, 3 months ago (2010-09-17 21:59:01 UTC) #28
michaeln
Thnx http://codereview.chromium.org/3165062/diff/79024/146003 File base/deletable_file_reference.cc (right): http://codereview.chromium.org/3165062/diff/79024/146003#newcode34 base/deletable_file_reference.cc:34: DeletableFileReference::GetOrCreate( On 2010/09/17 21:59:01, jianli wrote: > Can ...
10 years, 3 months ago (2010-09-17 22:04:31 UTC) #29
darin (slow to review)
very nice work getting all of this hooked up to testshell too! http://codereview.chromium.org/3165062/diff/79024/146004 File base/deletable_file_reference.h ...
10 years, 3 months ago (2010-09-17 22:47:49 UTC) #30
michaeln
haven't uploaded a new snapshot yet, just replying to comments http://codereview.chromium.org/3165062/diff/79024/146004 File base/deletable_file_reference.h (right): http://codereview.chromium.org/3165062/diff/79024/146004#newcode18 ...
10 years, 3 months ago (2010-09-18 00:18:38 UTC) #31
michaeln
> > how about putting this in src/webkit/fileapi/ instead? > > Might be nice to ...
10 years, 3 months ago (2010-09-18 01:10:48 UTC) #32
michaeln
New snapshot with changes outlined in previous comments.
10 years, 3 months ago (2010-09-18 01:54:57 UTC) #33
michaeln
hmmm... should we just smush webkit/blob and webkit/fileapi together?
10 years, 3 months ago (2010-09-18 03:08:41 UTC) #34
michaeln
http://codereview.chromium.org/3165062/diff/148001/133019 File webkit/blob/deletable_file_reference_unittest.cc (right): http://codereview.chromium.org/3165062/diff/148001/133019#newcode15 webkit/blob/deletable_file_reference_unittest.cc:15: MessageLoop loop; that's wierd... something is different about test_shell_tests ...
10 years, 3 months ago (2010-09-18 06:25:38 UTC) #35
darin (slow to review)
probably... that is how it is in WebCore On Fri, Sep 17, 2010 at 8:08 ...
10 years, 3 months ago (2010-09-19 03:46:43 UTC) #36
darin (slow to review)
http://codereview.chromium.org/3165062/diff/148001/133019 File webkit/blob/deletable_file_reference_unittest.cc (right): http://codereview.chromium.org/3165062/diff/148001/133019#newcode15 webkit/blob/deletable_file_reference_unittest.cc:15: MessageLoop loop; yes, in test_shell_tests there is already a ...
10 years, 3 months ago (2010-09-19 03:48:03 UTC) #37
michaeln
On 2010/09/18 06:25:38, michaeln wrote: > http://codereview.chromium.org/3165062/diff/148001/133019 > File webkit/blob/deletable_file_reference_unittest.cc (right): > > http://codereview.chromium.org/3165062/diff/148001/133019#newcode15 > ...
10 years, 3 months ago (2010-09-20 19:05:04 UTC) #38
michaeln
New patch, synced and merged a conflict.
10 years, 3 months ago (2010-09-20 19:55:51 UTC) #39
darin (slow to review)
LGTM
10 years, 3 months ago (2010-09-21 07:03:09 UTC) #40
michaeln
Ooops... there was a perf regression with this :(
10 years, 3 months ago (2010-09-24 20:31:18 UTC) #41
michaeln
On 2010/09/24 20:31:18, michaeln wrote: > Ooops... there was a perf regression with this :( ...
10 years, 3 months ago (2010-09-24 20:31:44 UTC) #42
darin (slow to review)
see my comment at the end of that bug. did i understand correctly? -darin On ...
10 years, 3 months ago (2010-09-24 20:42:16 UTC) #43
michaeln
> see my comment at the end of that bug. did i understand correctly? Yes, ...
10 years, 3 months ago (2010-09-24 21:53:27 UTC) #44
michaeln
Per http://code.google.com/p/chromium/issues/detail?id=56752... I'll resubmit this change with the addition of an extra line of code ...
10 years, 3 months ago (2010-09-24 23:38:38 UTC) #45
darin (slow to review)
10 years, 3 months ago (2010-09-25 04:47:47 UTC) #46
On Fri, Sep 24, 2010 at 4:38 PM, <michaeln@chromium.org> wrote:

> Per http://code.google.com/p/chromium/issues/detail?id=56752...
>
> I'll resubmit this change with the addition of an extra line of code to
> conditionally send the new IPC only when needed.
>
>  if (request_.download_to_file)  // <--- this is the extra line
>
>    dispatcher_->message_sender()->Send(
>        new ViewHostMsg_ResourceLoaderDeleted(request_id_));
>
> Since the semantics of the message are changing, I'll rename the message to
> something along the lines of...
>  ViewHostMsg_Resource_ReleaseDownloadedFile(request_id_);


SGTM


>
>
> http://codereview.chromium.org/3165062/show
>

Powered by Google App Engine
This is Rietveld 408576698