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

Issue 1356623002: mojo: Add DataURLFetcher for processing data: urls. (Closed)

Created:
5 years, 3 months ago by sadrul
Modified:
5 years, 3 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

mojo: Add DataURLFetcher for processing data: urls. BUG=531560 Committed: https://crrev.com/14b2f13878ac9f207e553e1d70343750acbe29c0 Cr-Commit-Position: refs/heads/master@{#349437}

Patch Set 1 #

Total comments: 1

Patch Set 2 : tot.merge #

Patch Set 3 : lolgyp #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+255 lines, -20 lines) Patch
M mojo/fetcher/BUILD.gn View 1 2 chunks +6 lines, -3 lines 0 comments Download
M mojo/fetcher/DEPS View 1 chunk +4 lines, -0 lines 0 comments Download
A + mojo/fetcher/data_fetcher.h View 3 chunks +9 lines, -17 lines 0 comments Download
A mojo/fetcher/data_fetcher.cc View 1 chunk +113 lines, -0 lines 3 comments Download
A mojo/fetcher/data_fetcher_unittest.cc View 1 chunk +113 lines, -0 lines 0 comments Download
M mojo/mojo_shell.gyp View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M mojo/package_manager/package_manager_impl.cc View 1 2 chunks +6 lines, -0 lines 0 comments Download
M mojo/runner/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
sadrul
https://codereview.chromium.org/1356623002/diff/1/mojo/fetcher/data_fetcher.cc File mojo/fetcher/data_fetcher.cc (right): https://codereview.chromium.org/1356623002/diff/1/mojo/fetcher/data_fetcher.cc#newcode55 mojo/fetcher/data_fetcher.cc:55: if (net::DataURL::Parse(url_, &mime_type, &charset, &data)) { I am not ...
5 years, 3 months ago (2015-09-17 12:53:59 UTC) #2
Ben Goodger (Google)
lgtm
5 years, 3 months ago (2015-09-17 17:10:00 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1356623002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1356623002/60001
5 years, 3 months ago (2015-09-17 17:20:06 UTC) #6
commit-bot: I haz the power
Committed patchset #3 (id:60001)
5 years, 3 months ago (2015-09-17 17:26:11 UTC) #7
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/14b2f13878ac9f207e553e1d70343750acbe29c0 Cr-Commit-Position: refs/heads/master@{#349437}
5 years, 3 months ago (2015-09-17 17:26:54 UTC) #8
sky
One potential problem is that if this url originates from an html_viewer, then we want ...
5 years, 3 months ago (2015-09-17 23:21:51 UTC) #10
sadrul
https://codereview.chromium.org/1356623002/diff/60001/mojo/fetcher/data_fetcher.cc File mojo/fetcher/data_fetcher.cc (right): https://codereview.chromium.org/1356623002/diff/60001/mojo/fetcher/data_fetcher.cc#newcode21 mojo/fetcher/data_fetcher.cc:21: uint32_t num_bytes = static_cast<uint32_t>(data.size()); On 2015/09/17 23:21:51, sky wrote: ...
5 years, 3 months ago (2015-09-18 05:08:58 UTC) #11
sky
5 years, 3 months ago (2015-09-18 16:02:38 UTC) #12
Message was sent while issue was closed.
https://codereview.chromium.org/1356623002/diff/60001/mojo/fetcher/data_fetch...
File mojo/fetcher/data_fetcher.cc (right):

https://codereview.chromium.org/1356623002/diff/60001/mojo/fetcher/data_fetch...
mojo/fetcher/data_fetcher.cc:21: uint32_t num_bytes =
static_cast<uint32_t>(data.size());
On 2015/09/18 05:08:58, sadrul wrote:
> On 2015/09/17 23:21:51, sky wrote:
> > Might it be possible for the string to be bigger than uint32_t?
> 
> I suppose it could be. Perhaps we should check if that is the case, and abort?
> For example:
> 
> diff --git a/mojo/fetcher/data_fetcher.cc b/mojo/fetcher/data_fetcher.cc
> index e785be7..51c25a8 100644
> --- a/mojo/fetcher/data_fetcher.cc
> +++ b/mojo/fetcher/data_fetcher.cc
> @@ -18,6 +18,8 @@ namespace fetcher {
>  
>  ScopedDataPipeConsumerHandle CreateConsumerHandleForString(
>      const std::string& data) {
> +  if (data.size() > std::numeric_limits<uint32_t>::max())
> +    return ScopedDataPipeConsumerHandle();
>    uint32_t num_bytes = static_cast<uint32_t>(data.size());
>    MojoCreateDataPipeOptions options;
>    options.struct_size = sizeof(MojoCreateDataPipeOptions);

Fine by me.

Powered by Google App Engine
This is Rietveld 408576698