| 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/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/metrics/histogram_macros.h" | 11 #include "base/metrics/histogram_macros.h" |
| 12 #include "base/task_runner_util.h" | 12 #include "base/task_runner_util.h" |
| 13 #include "base/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "base/time/default_clock.h" | 14 #include "base/time/default_clock.h" |
| 15 #include "net/http/http_response_headers.h" | 15 #include "net/http/http_response_headers.h" |
| 16 #include "net/url_request/url_fetcher.h" | 16 #include "net/url_request/url_fetcher.h" |
| 17 #include "net/url_request/url_request_context_getter.h" | 17 #include "net/url_request/url_request_context_getter.h" |
| 18 #include "net/url_request/url_request_status.h" | 18 #include "net/url_request/url_request_status.h" |
| 19 | 19 |
| 20 namespace search_provider_logos { | 20 namespace search_provider_logos { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 void LogoTracker::OnURLFetchDownloadProgress(const net::URLFetcher* source, | 327 void LogoTracker::OnURLFetchDownloadProgress(const net::URLFetcher* source, |
| 328 int64_t current, | 328 int64_t current, |
| 329 int64_t total) { | 329 int64_t total) { |
| 330 if (total > kMaxDownloadBytes || current > kMaxDownloadBytes) { | 330 if (total > kMaxDownloadBytes || current > kMaxDownloadBytes) { |
| 331 LOG(WARNING) << "Search provider logo exceeded download size limit"; | 331 LOG(WARNING) << "Search provider logo exceeded download size limit"; |
| 332 ReturnToIdle(DOWNLOAD_OUTCOME_DOWNLOAD_FAILED); | 332 ReturnToIdle(DOWNLOAD_OUTCOME_DOWNLOAD_FAILED); |
| 333 } | 333 } |
| 334 } | 334 } |
| 335 | 335 |
| 336 } // namespace search_provider_logos | 336 } // namespace search_provider_logos |
| OLD | NEW |