Commit 09fa43da authored by Jonathan Freed's avatar Jonathan Freed Committed by Commit Bot

Checking gurl is valid before calling spec().

Also removing static_cast accidentally left in previously.

Bug: 1128169
Change-Id: Ica92357953149aa19bdb2ffc300f81363662fe94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537923
Auto-Submit: Jonathan Freed <freedjm@chromium.org>
Reviewed-by: default avatarDan H <harringtond@chromium.org>
Commit-Queue: Jonathan Freed <freedjm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827450}
parent 31450024
......@@ -89,9 +89,9 @@ void PrefetchImagesTask::PrefetchImagesFromModel(const StreamModel& model) {
void PrefetchImagesTask::MaybePrefetchImage(const GURL& gurl) {
// If we've already fetched this url, or we've hit the max number of fetches,
// then don't send a fetch request.
if ((previously_fetched_.find(gurl.spec()) != previously_fetched_.end()) ||
previously_fetched_.size() >=
static_cast<size_t>(max_images_per_refresh_))
if (!gurl.is_valid() ||
(previously_fetched_.find(gurl.spec()) != previously_fetched_.end()) ||
previously_fetched_.size() >= max_images_per_refresh_)
return;
previously_fetched_.insert(gurl.spec());
stream_->PrefetchImage(gurl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment