Index: content/browser/background_fetch/background_fetch_client_proxy.h |
diff --git a/content/browser/background_fetch/background_fetch_client_proxy.h b/content/browser/background_fetch/background_fetch_client_proxy.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3f57db173d3c6c4e15c8769a28ed7e4e8e9ef7be |
--- /dev/null |
+++ b/content/browser/background_fetch/background_fetch_client_proxy.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_PROXY_H_ |
+#define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_PROXY_H_ |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "content/public/browser/background_fetch_client.h" |
+ |
+namespace content { |
+ |
+class BackgroundFetchContext; |
+ |
+// The BackgroundFetchClientProxy exists to proxy calls from the |
+// BackgroundFetchContext, which lives on the IO thread, to the |
+// BackgroundFetchClient which lives on the UI thread and back through the |
+// BackgroundFetchClient::Delegate. |
+class CONTENT_EXPORT BackgroundFetchClientProxy |
+ : public BackgroundFetchClient::Delegate { |
+ public: |
+ explicit BackgroundFetchClientProxy(BackgroundFetchContext* context); |
+ ~BackgroundFetchClientProxy() override; |
+ |
+ // BackgroundFetchClient::Delegate implementation. |
+ void CleanupAllTasks() override; |
+ void CancelDownload(const std::string& registration_id) override; |
+ void PauseDownload(const std::string& registration_id) override; |
+ void ResumeDownload(const std::string& registration_id) override; |
+ |
+ private: |
+ // The BackgroundFetchClientProxy is owned by the BackgroundFetchContext. |
+ BackgroundFetchContext* background_fetch_context_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BackgroundFetchClientProxy); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CLIENT_PROXY_H_ |