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

Unified Diff: components/ntp_snippets/remote/ntp_snippets_fetcher.h

Issue 2548343002: NTPSnippets: Set MaxRetriesOn5xx only for interactive requests. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/remote/ntp_snippets_fetcher.h
diff --git a/components/ntp_snippets/remote/ntp_snippets_fetcher.h b/components/ntp_snippets/remote/ntp_snippets_fetcher.h
index 62437c99096287262a34c2022b1411af6ca86f7f..1af70ba6eb6dc71df9458deeb23adff974ace490 100644
--- a/components/ntp_snippets/remote/ntp_snippets_fetcher.h
+++ b/components/ntp_snippets/remote/ntp_snippets_fetcher.h
@@ -182,6 +182,8 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
BuildRequestWithUILanguageOnly);
FRIEND_TEST_ALL_PREFIXES(NTPSnippetsFetcherTest,
BuildRequestWithOtherLanguageOnly);
+ FRIEND_TEST_ALL_PREFIXES(NTPSnippetsFetcherTest,
+ BuildRequestFetcherDependingOnInteractivity);
friend class NTPSnippetsFetcherTest;
enum FetchAPI {
@@ -223,8 +225,13 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
const scoped_refptr<net::URLRequestContextGetter>& context_getter);
RequestBuilder& SetUserClassifier(const UserClassifier& user_classifier);
- std::string PreviewRequestBodyForTesting() { return BuildBody(); }
- std::string PreviewRequestHeadersForTesting() { return BuildHeaders(); }
+ std::string PreviewRequestBodyForTesting() const { return BuildBody(); }
tschumann 2016/12/05 17:26:33 hmm... this has a smell and doesn't seem to scale
fhorschig 2016/12/06 14:31:40 Reverted changes made here and added a TODO. In or
+ std::string PreviewRequestHeadersForTesting() const {
+ return BuildHeaders();
+ }
+ // Creates a valid net::URLFetcher that has no request and can therefore not
+ // fetch and trigger a delegate. Body and Header are empty.
+ std::unique_ptr<net::URLFetcher> PreviewURLFetcherForTesting() const;
RequestBuilder& SetUserClassForTesting(const std::string& user_class) {
user_class_ = user_class;
return *this;

Powered by Google App Engine
This is Rietveld 408576698