OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_PROXY_H_ |
| 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_PROXY_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "content/public/browser/background_fetch_client.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class BackgroundFetchContext; |
| 16 |
| 17 // The BackgroundFetchClientProxy exists to proxy calls from the |
| 18 // BackgroundFetchContext, which lives on the IO thread, to the |
| 19 // BackgroundFetchClient which lives on the UI thread and back through the |
| 20 // BackgroundFetchClient::Delegate. |
| 21 class CONTENT_EXPORT BackgroundFetchClientProxy |
| 22 : public BackgroundFetchClient::Delegate { |
| 23 public: |
| 24 explicit BackgroundFetchClientProxy(BackgroundFetchContext* context); |
| 25 ~BackgroundFetchClientProxy() override; |
| 26 |
| 27 // BackgroundFetchClient::Delegate implementation. |
| 28 void CleanupAllTasks() override; |
| 29 void CancelDownload(const std::string& registration_id) override; |
| 30 void PauseDownload(const std::string& registration_id) override; |
| 31 void ResumeDownload(const std::string& registration_id) override; |
| 32 |
| 33 private: |
| 34 // The BackgroundFetchClientProxy is owned by the BackgroundFetchContext. |
| 35 BackgroundFetchContext* background_fetch_context_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchClientProxy); |
| 38 }; |
| 39 |
| 40 } // namespace content |
| 41 |
| 42 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_PROXY_H_ |
OLD | NEW |