Chromium Code Reviews| 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_ |