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_DATA_MANAGER_H_ | |
6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 | |
11 #include "content/browser/background_fetch/fetch_request.h" | |
12 #include "content/common/content_export.h" | |
13 #include "url/origin.h" | |
14 | |
15 namespace content { | |
16 | |
17 class BackgroundFetchContext; | |
18 | |
19 // The BackgroundFetchDataManager keeps track of all of the outstanding requests | |
20 // which are in process in the DownloadManager. When Chromium restarts, it is | |
21 // responsibile for reconnecting all the in progress downloads with an observer | |
22 // which will keep the metadata up to date. | |
23 class CONTENT_EXPORT BackgroundFetchDataManager { | |
24 public: | |
25 BackgroundFetchDataManager(BackgroundFetchContext* background_fetch_context); | |
Peter Beverloo
2017/02/13 18:35:06
nit: explicit
harkness
2017/02/14 13:52:46
Done.
| |
26 ~BackgroundFetchDataManager(); | |
27 | |
28 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.
| |
29 | |
30 private: | |
31 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.
| |
32 | |
33 // Map from <Origin, tag> to the FetchRequest for that tag. | |
34 using FetchIdentifier = std::pair<url::Origin, std::string>; | |
35 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.
| |
36 }; | |
Peter Beverloo
2017/02/13 18:35:06
DISALLOW_COPY_AND_ASSIGN()
harkness
2017/02/14 13:52:46
Done.
| |
37 | |
38 } // namespace content | |
39 | |
40 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_H_ | |
OLD | NEW |