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

Side by Side 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698