OLD | NEW |
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 Loading... |
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 |
OLD | NEW |