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

Issue 5542001: Allow data URLs to trigger downloads, as they do in Firefox.... (Closed)

Created:
10 years ago by darin (slow to review)
Modified:
9 years, 7 months ago
Reviewers:
tony
CC:
chromium-reviews, darin-cc_chromium.org
Visibility:
Public.

Description

Allow data URLs to trigger downloads, as they do in Firefox. Unfortunately, many of our tests rely on being able to use WebURLLoader to load data: URLs when there is no ResourceLoaderBridge implementation. In those tests, we would crash if we try to use the ResourceLoaderBridge. To workaround that, and because it probably a good optimization anyways, I decided to check if the data URL has a supported MIME type, and if it does, then I let it load directly as before. Since data URLs may be very large, I modified DataURL::Parse to skip parsing the 'data' section of the URL if the corresponding out param is null. R=tony BUG=38546 TEST=none (I would like to add a download test, but they are all disabled or flaky.) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=68212

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -1 line) Patch
M net/base/data_url.h View 1 3 1 chunk +3 lines, -0 lines 0 comments Download
M net/base/data_url.cc View 1 3 1 chunk +4 lines, -0 lines 0 comments Download
M webkit/glue/weburlloader_impl.cc View 1 3 4 chunks +27 lines, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
darin (slow to review)
10 years ago (2010-12-02 00:56:55 UTC) #1
tony
I see, LGTM.
10 years ago (2010-12-02 01:07:40 UTC) #2
darin (slow to review)
Tony, please take another look. I had to make some more changes to support our ...
10 years ago (2010-12-03 17:39:48 UTC) #3
darin (slow to review)
Patch set #2 has the faster implementation, but it has the drawback of making DataURL::Parse ...
10 years ago (2010-12-03 17:40:50 UTC) #4
tony
10 years ago (2010-12-03 18:13:01 UTC) #5
On 2010/12/03 17:40:50, darin wrote:
> Patch set #2 has the faster implementation, but it has the drawback of making
> DataURL::Parse not validate the 'data' section of the URL.  That just didn't
> seem worth it to me.

LGTM, yeah, I agree that validating the data section doesn't seem important.

Powered by Google App Engine
This is Rietveld 408576698