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

Side by Side Diff: components/ntp_snippets/remote/remote_suggestions_provider.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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_REMOTE_SUGGESTIONS_PROVIDER_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 14 matching lines...) Expand all
25 using FetchStatusCallback = base::Callback<void(Status status_code)>; 25 using FetchStatusCallback = base::Callback<void(Status status_code)>;
26 26
27 ~RemoteSuggestionsProvider() override; 27 ~RemoteSuggestionsProvider() override;
28 28
29 // Fetches suggestions from the server for all remote categories and replaces 29 // Fetches suggestions from the server for all remote categories and replaces
30 // old suggestions by the new ones. The request to the server is performed as 30 // old suggestions by the new ones. The request to the server is performed as
31 // an background request. Background requests are used for actions not 31 // an background request. Background requests are used for actions not
32 // triggered by the user and have lower priority on the server. After the 32 // triggered by the user and have lower priority on the server. After the
33 // fetch finished, the provided |callback| will be triggered with the status 33 // fetch finished, the provided |callback| will be triggered with the status
34 // of the fetch (unless nullptr). 34 // of the fetch (unless nullptr).
35 // TODO(jkrcal): Change to FetchStatusCallback callback as callbacks already
36 // have is_empty() functionality. crbug.com/676317
35 virtual void RefetchInTheBackground( 37 virtual void RefetchInTheBackground(
36 std::unique_ptr<FetchStatusCallback> callback) = 0; 38 std::unique_ptr<FetchStatusCallback> callback) = 0;
37 39
38 virtual const RemoteSuggestionsFetcher* suggestions_fetcher_for_debugging() 40 virtual const RemoteSuggestionsFetcher* suggestions_fetcher_for_debugging()
39 const = 0; 41 const = 0;
40 42
41 protected: 43 protected:
42 RemoteSuggestionsProvider(Observer* observer); 44 RemoteSuggestionsProvider(Observer* observer);
43 }; 45 };
44 46
45 } // namespace ntp_snippets 47 } // namespace ntp_snippets
46 48
47 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_ 49 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698