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

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

Issue 2678273003: Initial framework setup and skeleton for BackgroundFetchContext (Closed)
Patch Set: Remove BackgroundFetchDownloadObserver until it's used. Created 3 years, 10 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_data_manager.h
diff --git a/content/browser/background_fetch/background_fetch_data_manager.h b/content/browser/background_fetch/background_fetch_data_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..bf9267727a8aede36531df5ef7d2ae79bd03d71a
--- /dev/null
+++ b/content/browser/background_fetch/background_fetch_data_manager.h
@@ -0,0 +1,40 @@
+// 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_DATA_MANAGER_H_
+#define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_H_
+
+#include <map>
+#include <string>
+
+#include "content/browser/background_fetch/fetch_request.h"
+#include "content/common/content_export.h"
+#include "url/origin.h"
+
+namespace content {
+
+class BackgroundFetchContext;
+
+// The BackgroundFetchDataManager keeps track of all of the outstanding requests
+// which are in process in the DownloadManager. When Chromium restarts, it is
+// responsibile for reconnecting all the in progress downloads with an observer
+// which will keep the metadata up to date.
+class CONTENT_EXPORT BackgroundFetchDataManager {
+ public:
+ BackgroundFetchDataManager(BackgroundFetchContext* background_fetch_context);
Peter Beverloo 2017/02/13 18:35:06 nit: explicit
harkness 2017/02/14 13:52:46 Done.
+ ~BackgroundFetchDataManager();
+
+ void CreateRequest(const FetchRequest& fetch_request);
Peter Beverloo 2017/02/13 18:35:06 nit: This is a public method, please document it
harkness 2017/02/14 13:52:46 Done.
+
+ private:
+ BackgroundFetchContext* background_fetch_context_;
Peter Beverloo 2017/02/13 18:35:05 Raw pointers need a line of documentation about wh
harkness 2017/02/14 13:52:46 Done.
+
+ // Map from <Origin, tag> to the FetchRequest for that tag.
+ using FetchIdentifier = std::pair<url::Origin, std::string>;
+ std::map<FetchIdentifier, FetchRequest> fetch_map_;
Peter Beverloo 2017/02/13 18:35:06 We know this to be functionally wrong - fetches wi
harkness 2017/02/14 13:52:46 Done.
+};
Peter Beverloo 2017/02/13 18:35:06 DISALLOW_COPY_AND_ASSIGN()
harkness 2017/02/14 13:52:46 Done.
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698