| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ntp_snippets/ntp_snippets_fetcher.h" | 5 #include "components/ntp_snippets/ntp_snippets_fetcher.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // a network request, so don't record FetchTime in those cases. | 589 // a network request, so don't record FetchTime in those cases. |
| 590 if (result != FetchResult::EMPTY_HOSTS && | 590 if (result != FetchResult::EMPTY_HOSTS && |
| 591 result != FetchResult::OAUTH_TOKEN_ERROR) { | 591 result != FetchResult::OAUTH_TOKEN_ERROR) { |
| 592 UMA_HISTOGRAM_TIMES("NewTabPage.Snippets.FetchTime", | 592 UMA_HISTOGRAM_TIMES("NewTabPage.Snippets.FetchTime", |
| 593 tick_clock_->NowTicks() - fetch_start_time_); | 593 tick_clock_->NowTicks() - fetch_start_time_); |
| 594 } | 594 } |
| 595 UMA_HISTOGRAM_ENUMERATION("NewTabPage.Snippets.FetchResult", | 595 UMA_HISTOGRAM_ENUMERATION("NewTabPage.Snippets.FetchResult", |
| 596 static_cast<int>(result), | 596 static_cast<int>(result), |
| 597 static_cast<int>(FetchResult::RESULT_MAX)); | 597 static_cast<int>(FetchResult::RESULT_MAX)); |
| 598 | 598 |
| 599 DVLOG(1) << "Fetch finished: " << last_status_; |
| 599 if (!snippets_available_callback_.is_null()) | 600 if (!snippets_available_callback_.is_null()) |
| 600 snippets_available_callback_.Run(std::move(snippets)); | 601 snippets_available_callback_.Run(std::move(snippets)); |
| 601 } | 602 } |
| 602 | 603 |
| 603 } // namespace ntp_snippets | 604 } // namespace ntp_snippets |
| OLD | NEW |