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

Side by Side Diff: components/ntp_snippets/remote/json_request.h

Issue 2714863004: [Remote suggestions] Move the throttler into the Scheduler (Closed)
Patch Set: Ilya's comment Created 3 years, 9 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
« no previous file with comments | « no previous file | components/ntp_snippets/remote/remote_suggestions_fetcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_ 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 17 matching lines...) Expand all
28 28
29 namespace ntp_snippets { 29 namespace ntp_snippets {
30 class UserClassifier; 30 class UserClassifier;
31 31
32 namespace internal { 32 namespace internal {
33 33
34 // Enumeration listing all possible outcomes for fetch attempts. Used for UMA 34 // Enumeration listing all possible outcomes for fetch attempts. Used for UMA
35 // histograms, so do not change existing values. Insert new values at the end, 35 // histograms, so do not change existing values. Insert new values at the end,
36 // and update the histogram definition. 36 // and update the histogram definition.
37 enum class FetchResult { 37 enum class FetchResult {
38 SUCCESS, 38 SUCCESS = 0,
39 DEPRECATED_EMPTY_HOSTS, 39 // DEPRECATED_EMPTY_HOSTS = 1,
40 URL_REQUEST_STATUS_ERROR, 40 URL_REQUEST_STATUS_ERROR = 2,
41 HTTP_ERROR, 41 HTTP_ERROR = 3,
42 JSON_PARSE_ERROR, 42 JSON_PARSE_ERROR = 4,
43 INVALID_SNIPPET_CONTENT_ERROR, 43 INVALID_SNIPPET_CONTENT_ERROR = 5,
44 OAUTH_TOKEN_ERROR, 44 OAUTH_TOKEN_ERROR = 6,
45 INTERACTIVE_QUOTA_ERROR, 45 // DEPRECATED_INTERACTIVE_QUOTA_ERROR = 7,
46 NON_INTERACTIVE_QUOTA_ERROR, 46 // DEPRECATED_NON_INTERACTIVE_QUOTA_ERROR = 8,
47 RESULT_MAX 47 RESULT_MAX = 9
48 }; 48 };
49 49
50 enum FetchAPI { 50 enum FetchAPI {
51 CHROME_READER_API, 51 CHROME_READER_API,
52 CHROME_CONTENT_SUGGESTIONS_API, 52 CHROME_CONTENT_SUGGESTIONS_API,
53 }; 53 };
54 54
55 // A single request to query remote suggestions. On success, the suggestions are 55 // A single request to query remote suggestions. On success, the suggestions are
56 // returned in parsed JSON form (base::Value). 56 // returned in parsed JSON form (base::Value).
57 class JsonRequest : public net::URLFetcherDelegate { 57 class JsonRequest : public net::URLFetcherDelegate {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 base::WeakPtrFactory<JsonRequest> weak_ptr_factory_; 177 base::WeakPtrFactory<JsonRequest> weak_ptr_factory_;
178 178
179 DISALLOW_COPY_AND_ASSIGN(JsonRequest); 179 DISALLOW_COPY_AND_ASSIGN(JsonRequest);
180 }; 180 };
181 181
182 } // namespace internal 182 } // namespace internal
183 183
184 } // namespace ntp_snippets 184 } // namespace ntp_snippets
185 185
186 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_ 186 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/remote/remote_suggestions_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698