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

Side by Side Diff: components/search_provider_logos/logo_tracker.cc

Issue 2378173002: Precache per-resource cap should be applied on network bytes used (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « components/search_provider_logos/logo_tracker.h ('k') | components/sync/core/http_bridge.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/search_provider_logos/logo_tracker.h" 5 #include "components/search_provider_logos/logo_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 base::PostTaskAndReplyWithResult( 334 base::PostTaskAndReplyWithResult(
335 background_task_runner_.get(), FROM_HERE, 335 background_task_runner_.get(), FROM_HERE,
336 base::Bind(parse_logo_response_func_, base::Passed(&response), 336 base::Bind(parse_logo_response_func_, base::Passed(&response),
337 response_time, parsing_failed), 337 response_time, parsing_failed),
338 base::Bind(&LogoTracker::OnFreshLogoParsed, 338 base::Bind(&LogoTracker::OnFreshLogoParsed,
339 weak_ptr_factory_.GetWeakPtr(), base::Owned(parsing_failed))); 339 weak_ptr_factory_.GetWeakPtr(), base::Owned(parsing_failed)));
340 } 340 }
341 341
342 void LogoTracker::OnURLFetchDownloadProgress(const net::URLFetcher* source, 342 void LogoTracker::OnURLFetchDownloadProgress(const net::URLFetcher* source,
343 int64_t current, 343 int64_t current,
344 int64_t total) { 344 int64_t total,
345 int64_t current_network_bytes) {
345 if (total > kMaxDownloadBytes || current > kMaxDownloadBytes) { 346 if (total > kMaxDownloadBytes || current > kMaxDownloadBytes) {
346 LOG(WARNING) << "Search provider logo exceeded download size limit"; 347 LOG(WARNING) << "Search provider logo exceeded download size limit";
347 ReturnToIdle(DOWNLOAD_OUTCOME_DOWNLOAD_FAILED); 348 ReturnToIdle(DOWNLOAD_OUTCOME_DOWNLOAD_FAILED);
348 } 349 }
349 } 350 }
350 351
351 } // namespace search_provider_logos 352 } // namespace search_provider_logos
OLDNEW
« no previous file with comments | « components/search_provider_logos/logo_tracker.h ('k') | components/sync/core/http_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698