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

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

Issue 2686063003: [remote suggestions] Attach the fetch time to RemoteSnippets, ContentSnippets and SnippetArticle (Closed)
Patch Set: rebase Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/remote/json_request.h
diff --git a/components/ntp_snippets/remote/json_request.h b/components/ntp_snippets/remote/json_request.h
index 423d44c7cd27054820094fc03331fe2548ba360f..f498747a4a2621806d22c53f6c3ccdffa2ea5f4a 100644
--- a/components/ntp_snippets/remote/json_request.h
+++ b/components/ntp_snippets/remote/json_request.h
@@ -12,6 +12,7 @@
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
+#include "base/time/time.h"
#include "components/ntp_snippets/remote/request_params.h"
#include "components/ntp_snippets/status.h"
#include "components/translate/core/browser/language_model.h"
@@ -20,7 +21,7 @@
namespace base {
class Value;
-class TickClock;
+class Clock;
} // namespace base
class FetchAPI;
@@ -81,10 +82,10 @@ class JsonRequest : public net::URLFetcherDelegate {
Builder& SetLanguageModel(const translate::LanguageModel* language_model);
Builder& SetParams(const RequestParams& params);
Builder& SetParseJsonCallback(ParseJSONCallback callback);
- // The tick_clock borrowed from the fetcher will be injected into the
+ // The clock borrowed from the fetcher will be injected into the
// request. It will be used at build time and after the fetch returned.
// It has to be alive until the request is destroyed.
- Builder& SetTickClock(base::TickClock* tick_clock);
+ Builder& SetClock(base::Clock* clock);
Builder& SetUrl(const GURL& url);
Builder& SetUrlRequestContextGetter(
const scoped_refptr<net::URLRequestContextGetter>& context_getter);
@@ -115,7 +116,7 @@ class JsonRequest : public net::URLFetcherDelegate {
// Only required, if the request needs to be sent.
std::string auth_header_;
- base::TickClock* tick_clock_;
+ base::Clock* clock_;
FetchAPI fetch_api_;
RequestParams params_;
ParseJSONCallback parse_json_callback_;
@@ -131,7 +132,7 @@ class JsonRequest : public net::URLFetcherDelegate {
};
JsonRequest(base::Optional<Category> exclusive_category,
- base::TickClock* tick_clock,
+ base::Clock* clock,
const ParseJSONCallback& callback);
JsonRequest(JsonRequest&&);
~JsonRequest() override;
@@ -160,11 +161,11 @@ class JsonRequest : public net::URLFetcherDelegate {
// If set, only return results for this category.
base::Optional<Category> exclusive_category_;
- // Use the TickClock from the Fetcher to measure the fetch time. It will be
+ // Use the Clock from the Fetcher to measure the fetch time. It will be
// used on creation and after the fetch returned. It has to be alive until the
// request is destroyed.
- base::TickClock* tick_clock_;
- base::TimeTicks creation_time_;
+ base::Clock* clock_;
+ base::Time creation_time_;
// This callback is called to parse a json string. It contains callbacks for
// error and success cases.
« no previous file with comments | « components/ntp_snippets/content_suggestions_metrics_unittest.cc ('k') | components/ntp_snippets/remote/json_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698