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

Side by Side Diff: components/ntp_snippets/ntp_snippets_fetcher.cc

Issue 2255783002: Support server categories in NTPSnippetsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix after rebase Created 4 years, 3 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 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 // a network request, so don't record FetchTime in those cases. 608 // a network request, so don't record FetchTime in those cases.
609 if (result != FetchResult::EMPTY_HOSTS && 609 if (result != FetchResult::EMPTY_HOSTS &&
610 result != FetchResult::OAUTH_TOKEN_ERROR) { 610 result != FetchResult::OAUTH_TOKEN_ERROR) {
611 UMA_HISTOGRAM_TIMES("NewTabPage.Snippets.FetchTime", 611 UMA_HISTOGRAM_TIMES("NewTabPage.Snippets.FetchTime",
612 tick_clock_->NowTicks() - fetch_start_time_); 612 tick_clock_->NowTicks() - fetch_start_time_);
613 } 613 }
614 UMA_HISTOGRAM_ENUMERATION("NewTabPage.Snippets.FetchResult", 614 UMA_HISTOGRAM_ENUMERATION("NewTabPage.Snippets.FetchResult",
615 static_cast<int>(result), 615 static_cast<int>(result),
616 static_cast<int>(FetchResult::RESULT_MAX)); 616 static_cast<int>(FetchResult::RESULT_MAX));
617 617
618 DVLOG(1) << "Fetch finished: " << last_status_;
618 if (!snippets_available_callback_.is_null()) 619 if (!snippets_available_callback_.is_null())
619 snippets_available_callback_.Run(std::move(snippets)); 620 snippets_available_callback_.Run(std::move(snippets));
620 } 621 }
621 622
622 } // namespace ntp_snippets 623 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.h » ('j') | components/ntp_snippets/ntp_snippets_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698