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

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

Issue 2786023002: [Remote suggestions] Remove the unique_ptr wrapper around callbacks (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/remote/remote_suggestions_provider_impl.h
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider_impl.h b/components/ntp_snippets/remote/remote_suggestions_provider_impl.h
index 710231b132701e0d1821baebc71f900460da011c..847f6bc5599f9e678d6eae1e669f456bb7856854 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider_impl.h
+++ b/components/ntp_snippets/remote/remote_suggestions_provider_impl.h
@@ -137,8 +137,7 @@ class RemoteSuggestionsProviderImpl final : public RemoteSuggestionsProvider {
bool initialized() const { return ready() || state_ == State::DISABLED; }
// RemoteSuggestionsProvider implementation.
- void RefetchInTheBackground(
- std::unique_ptr<FetchStatusCallback> callback) override;
+ void RefetchInTheBackground(const FetchStatusCallback& callback) override;
// TODO(fhorschig): Remove this getter when there is an interface for the
// fetcher that allows better mocks.
@@ -293,7 +292,7 @@ class RemoteSuggestionsProviderImpl final : public RemoteSuggestionsProvider {
// the fetch finished, the provided |callback| will be triggered with the
// status of the fetch.
void FetchSuggestions(bool interactive_request,
- std::unique_ptr<FetchStatusCallback> callback);
+ const FetchStatusCallback& callback);
// Returns the URL of the image of a suggestion if it is among the current or
// among the archived suggestions in the matching category. Returns an empty
@@ -312,7 +311,7 @@ class RemoteSuggestionsProviderImpl final : public RemoteSuggestionsProvider {
// Callback for regular fetch requests with the RemoteSuggestionsFetcher.
void OnFetchFinished(
- std::unique_ptr<FetchStatusCallback> callback,
+ const FetchStatusCallback& callback,
bool interactive_request,
Status status,
RemoteSuggestionsFetcher::OptionalFetchedCategories fetched_categories);
@@ -448,7 +447,7 @@ class RemoteSuggestionsProviderImpl final : public RemoteSuggestionsProvider {
// The parameters for the fetch to perform later.
bool fetch_when_ready_interactive_;
- std::unique_ptr<FetchStatusCallback> fetch_when_ready_callback_;
+ FetchStatusCallback fetch_when_ready_callback_;
// Set to true if ClearHistoryDependentState is called while the service isn't
// ready. The nuke will be executed once the service finishes initialization

Powered by Google App Engine
This is Rietveld 408576698