Chromium Code Reviews| Index: components/history/core/browser/web_history_service.h |
| diff --git a/components/history/core/browser/web_history_service.h b/components/history/core/browser/web_history_service.h |
| index 523dbf67d81c8ec521b3a4f94b2f03bf8e87dcb5..9962b6f0238f4d07da5e46d35e391cd864d0af27 100644 |
| --- a/components/history/core/browser/web_history_service.h |
| +++ b/components/history/core/browser/web_history_service.h |
| @@ -73,6 +73,8 @@ class WebHistoryService : public KeyedService { |
| typedef base::Callback<void(bool success, bool new_enabled_value)> |
| AudioWebHistoryCallback; |
| + typedef base::Callback<void(bool success)> QueryWebAndAppActivityCallback; |
| + |
| typedef base::Callback<void(Request*, bool success)> CompletionCallback; |
| WebHistoryService( |
| @@ -111,6 +113,10 @@ class WebHistoryService : public KeyedService { |
| virtual void SetAudioHistoryEnabled(bool new_enabled_value, |
| const AudioWebHistoryCallback& callback); |
| + // Queries whether web and app activity is enabled on the server. |
| + virtual void QueryWebAndAppActivity( |
| + const QueryWebAndAppActivityCallback& callback); |
| + |
| // Used for tests. |
| size_t GetNumberOfPendingAudioHistoryRequests(); |
| @@ -152,6 +158,14 @@ class WebHistoryService : public KeyedService { |
| WebHistoryService::Request* request, |
| bool success); |
| + // Called by |request| when a web and app activity query has completed. |
| + // Unpacks the response and calls |callback|, which is the original callback |
| + // that was passed to QueryWebAndAppActivity(). |
| + void QueryWebAndAppActivityCompletionCallback( |
| + const WebHistoryService::QueryWebAndAppActivityCallback& callback, |
| + WebHistoryService::Request* request, |
| + bool success); |
| + |
| private: |
| friend class WebHistoryServiceTest; |
| @@ -175,6 +189,10 @@ class WebHistoryService : public KeyedService { |
| // Pending requests to be canceled if not complete by profile shutdown. |
| std::set<Request*> pending_audio_history_requests_; |
| + // Pending web and app activity queries to be canceled if not complete by |
| + // profile shutdown. |
| + std::set<Request*> pending_web_and_app_activity_requests_; |
|
sdefresne
2016/03/24 09:50:07
I do not see the code cancelling those requests on
msramek
2016/03/24 12:53:22
Thanks for catching this. Done.
|
| + |
| base::WeakPtrFactory<WebHistoryService> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(WebHistoryService); |