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

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

Issue 2714863004: [Remote suggestions] Move the throttler into the Scheduler (Closed)
Patch Set: Comments #1 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,
Ilya Sherman 2017/02/27 19:32:26 I'd suggest keeping a comment line like // DEPR
39 DEPRECATED_EMPTY_HOSTS, 39 URL_REQUEST_STATUS_ERROR = 2,
40 URL_REQUEST_STATUS_ERROR, 40 HTTP_ERROR = 3,
41 HTTP_ERROR, 41 JSON_PARSE_ERROR = 4,
42 JSON_PARSE_ERROR, 42 INVALID_SNIPPET_CONTENT_ERROR = 5,
43 INVALID_SNIPPET_CONTENT_ERROR, 43 OAUTH_TOKEN_ERROR = 6,
44 OAUTH_TOKEN_ERROR, 44 // Next available ID: 9 (due to some values being deprecated).
45 INTERACTIVE_QUOTA_ERROR, 45 RESULT_MAX = 9
46 NON_INTERACTIVE_QUOTA_ERROR,
47 RESULT_MAX
48 }; 46 };
49 47
50 enum FetchAPI { 48 enum FetchAPI {
51 CHROME_READER_API, 49 CHROME_READER_API,
52 CHROME_CONTENT_SUGGESTIONS_API, 50 CHROME_CONTENT_SUGGESTIONS_API,
53 }; 51 };
54 52
55 // A single request to query remote suggestions. On success, the suggestions are 53 // A single request to query remote suggestions. On success, the suggestions are
56 // returned in parsed JSON form (base::Value). 54 // returned in parsed JSON form (base::Value).
57 class JsonRequest : public net::URLFetcherDelegate { 55 class JsonRequest : public net::URLFetcherDelegate {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 base::WeakPtrFactory<JsonRequest> weak_ptr_factory_; 175 base::WeakPtrFactory<JsonRequest> weak_ptr_factory_;
178 176
179 DISALLOW_COPY_AND_ASSIGN(JsonRequest); 177 DISALLOW_COPY_AND_ASSIGN(JsonRequest);
180 }; 178 };
181 179
182 } // namespace internal 180 } // namespace internal
183 181
184 } // namespace ntp_snippets 182 } // namespace ntp_snippets
185 183
186 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_ 184 #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