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

Side by Side Diff: components/precache/core/precache_fetcher.cc

Issue 1551433002: Switch to standard integer types in components/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/precache/core/precache_fetcher.h" 5 #include "components/precache/core/precache_fetcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 DCHECK_NE(std::string(), prefix) 331 DCHECK_NE(std::string(), prefix)
332 << "Could not determine the precache manifest URL prefix."; 332 << "Could not determine the precache manifest URL prefix.";
333 333
334 // Keep track of manifest URLs that are being fetched, in order to remove 334 // Keep track of manifest URLs that are being fetched, in order to remove
335 // duplicates. 335 // duplicates.
336 base::hash_set<std::string> unique_manifest_urls; 336 base::hash_set<std::string> unique_manifest_urls;
337 337
338 // Attempt to fetch manifests for starting hosts up to the maximum top sites 338 // Attempt to fetch manifests for starting hosts up to the maximum top sites
339 // count. If a manifest does not exist for a particular starting host, then 339 // count. If a manifest does not exist for a particular starting host, then
340 // the fetch will fail, and that starting host will be ignored. 340 // the fetch will fail, and that starting host will be ignored.
341 int64 rank = 0; 341 int64_t rank = 0;
342 for (const std::string& host : starting_hosts_) { 342 for (const std::string& host : starting_hosts_) {
343 ++rank; 343 ++rank;
344 if (rank > config.top_sites_count()) 344 if (rank > config.top_sites_count())
345 break; 345 break;
346 unique_manifest_urls.insert(ConstructManifestURL(prefix, host)); 346 unique_manifest_urls.insert(ConstructManifestURL(prefix, host));
347 } 347 }
348 348
349 for (const std::string& url : config.forced_site()) 349 for (const std::string& url : config.forced_site())
350 unique_manifest_urls.insert(ConstructManifestURL(prefix, url)); 350 unique_manifest_urls.insert(ConstructManifestURL(prefix, url));
351 351
(...skipping 18 matching lines...) Expand all
370 StartNextFetch(); 370 StartNextFetch();
371 } 371 }
372 372
373 void PrecacheFetcher::OnResourceFetchComplete(const URLFetcher& source) { 373 void PrecacheFetcher::OnResourceFetchComplete(const URLFetcher& source) {
374 // The resource has already been put in the cache during the fetch process, so 374 // The resource has already been put in the cache during the fetch process, so
375 // nothing more needs to be done for the resource. 375 // nothing more needs to be done for the resource.
376 StartNextFetch(); 376 StartNextFetch();
377 } 377 }
378 378
379 } // namespace precache 379 } // namespace precache
OLDNEW
« no previous file with comments | « components/precache/core/precache_fetcher.h ('k') | components/precache/core/precache_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698