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

Unified Diff: content/browser/background_fetch/background_fetch_client_proxy.h

Issue 2777063008: Connect BackgroundFetch to the OfflineItemCollection
Patch Set: Fixed incognito check and added tests Created 3 years, 8 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: 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_

Powered by Google App Engine
This is Rietveld 408576698