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

Issue 6131009: Fix bug 69468: Drag download does not work if there is URL redirection involv... (Closed)

Created:
9 years, 11 months ago by jianli
Modified:
9 years, 6 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., darin-cc_chromium.org, rdsmith+dwatch_chromium.org, brettw-cc_chromium.org, adeboor
Visibility:
Public.

Description

Fix bug 69468: Drag download does not work if there is URL redirection involved. The fix is to keep track of the original URL. BUG=69468 TEST=Manual test to verify. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=71494

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -1 line) Patch
M chrome/browser/download/download_item.h View 2 chunks +4 lines, -0 lines 4 comments Download
M chrome/browser/download/download_item.cc View 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/download/drag_download_file.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/history/download_create_info.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/download_resource_handler.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/renderer_host/download_resource_handler.cc View 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
jianli
9 years, 11 months ago (2011-01-12 23:54:21 UTC) #1
Randy Smith (Not in Mondays)
On 2011/01/12 23:54:21, jianli wrote: Jian: I'm reluctant, as I think that both download_item.h and ...
9 years, 11 months ago (2011-01-13 01:47:16 UTC) #2
jianli
On Wed, Jan 12, 2011 at 5:47 PM, <rdsmith@chromium.org> wrote: > On 2011/01/12 23:54:21, jianli ...
9 years, 11 months ago (2011-01-13 02:21:05 UTC) #3
Randy Smith (Not in Mondays)
On 2011/01/13 02:21:05, jianli wrote: > The current download observation model seems to be too ...
9 years, 11 months ago (2011-01-13 02:55:45 UTC) #4
jianli
On Wed, Jan 12, 2011 at 6:55 PM, <rdsmith@chromium.org> wrote: > On 2011/01/13 02:21:05, jianli ...
9 years, 11 months ago (2011-01-13 03:19:41 UTC) #5
Paweł Hajdan Jr.
Ideally we should postpone making such changes to the download code until it's properly cleaned ...
9 years, 11 months ago (2011-01-13 08:47:58 UTC) #6
Randy Smith (Not in Mondays)
On 2011/01/12 23:54:21, jianli wrote: Jian: How important is this change to you? Is this ...
9 years, 11 months ago (2011-01-13 15:00:23 UTC) #7
adeboor
Hi folks, For context, we had to turn off the attachment drag-out feature in gmail ...
9 years, 11 months ago (2011-01-13 17:45:48 UTC) #8
Randy Smith (Not in Mondays)
Pawel: Given this context, I'm inclined to let this change go through. Sync'ing based on ...
9 years, 11 months ago (2011-01-13 18:14:02 UTC) #9
Paweł Hajdan Jr.
Randy, you are actively working on this code so I'm fine with this CL. However, ...
9 years, 11 months ago (2011-01-14 07:07:30 UTC) #10
adeboor
Thank you for your flexibility, folks. Adam On Jan 13, 2011 11:07 PM, <phajdan.jr@chromium.org> wrote:
9 years, 11 months ago (2011-01-14 07:17:53 UTC) #11
Randy Smith (Not in Mondays)
LGTM, though I'd like a bit more documentation on the new member variables as noted ...
9 years, 11 months ago (2011-01-14 19:43:21 UTC) #12
jianli
9 years, 11 months ago (2011-01-14 19:52:04 UTC) #13
I will add more documentation as you suggest and land the patch. Thanks a
lot.


On Fri, Jan 14, 2011 at 11:43 AM, <rdsmith@chromium.org> wrote:

> LGTM, though I'd like a bit more documentation on the new member variables
> as
> noted below.
>
>
>
>
>
>
http://codereview.chromium.org/6131009/diff/1/chrome/browser/download/downloa...
> File chrome/browser/download/download_item.h (right):
>
>
>
http://codereview.chromium.org/6131009/diff/1/chrome/browser/download/downloa...
> chrome/browser/download/download_item.h:191: GURL original_url() const {
> return original_url_; }
> On 2011/01/13 08:47:59, Paweł Hajdan Jr. wrote:
>
>> We try to avoid adding more accessors like this one.
>>
>
> It's sorta like the difference between structures and classes;
> structures just carry data around, but classes hide that data and
> present an abstracted view of it.  There's no abstraction on top of any
> of the URLs, so I think direct set/get accessors are appropriate.  This
> might suggest a useful refactoring, where the pure, carried around data
> associated with the DownloadItem is exposed through a separate interface
> (maybe returns a const struct blah&) or maybe even is somehow a separate
> object, and DownloadItem is a more standard class, with abstractions and
> lack of access to internal data members.  But that's not this CL :-}.
>
>
>
>
http://codereview.chromium.org/6131009/diff/1/chrome/browser/download/downloa...
> chrome/browser/download/download_item.h:263: // The original URL before
> any redirection.
> On 2011/01/13 08:47:59, Paweł Hajdan Jr. wrote:
>
>> Now we have three URLs, and it's super-easy to confuse them all. The
>>
> difference
>
>> should be much better documented. Do we actually need all three?
>>
>
> I agree with this.  I'd suggest changing the doc on url_ to "The URL
> from which we are downloading", adding "... redirection by the server
> for this url" to the doc above.
>
> In terms of whether we actually need all three, it's a hard question to
> answer.  I just spent some time with codesearch, and found that
> url_/url() is used for:
> * download_util::CreateDownloadItemValue (-> DOM)
> * AutomationProvider::GetDictionaryFromDownloadItem (which could be used
> in a whole lot of ways--it's going to be hard to trace the uses of this
> down).
> * DragDownloadFile::ModelChanged (the usage this CL is modifying)
> * Browser::OnStartDownload(): Avoid showing the animation for downloads
> that are extensions.
> * OpenChromeExtension: Used for notification of extension install.
>
> referrer_url_/referrer_url() is only used in two of the above locations:
> the automation provider dictionary creation and OpenChromeExtension.
>
> Those usages make me nervous that we do indeed need all three, though
> possibly we should use the original_url_ (added here) for some of them.
>
> Yes, we might need to use original_url for some of them. We need to do more
investigations here.

>
> http://codereview.chromium.org/6131009/
>

Powered by Google App Engine
This is Rietveld 408576698