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

Side by Side Diff: content/browser/background_fetch/background_fetch_context.h

Issue 2781623009: Migrate part of the BackgroundFetchJobController to the UI thread (Closed)
Patch Set: Migrate part of the BackgroundFetchJobController to the UI thread 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/background_fetch/background_fetch_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_
6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 #include "third_party/WebKit/public/platform/modules/background_fetch/background _fetch.mojom.h" 16 #include "third_party/WebKit/public/platform/modules/background_fetch/background _fetch.mojom.h"
17 17
18 namespace net {
19 class URLRequestContextGetter;
20 }
21
18 namespace url { 22 namespace url {
19 class Origin; 23 class Origin;
20 } 24 }
21 25
22 namespace content { 26 namespace content {
23 27
24 class BackgroundFetchDataManager; 28 class BackgroundFetchDataManager;
25 class BackgroundFetchJobController; 29 class BackgroundFetchJobController;
26 struct BackgroundFetchOptions; 30 struct BackgroundFetchOptions;
27 class BackgroundFetchRegistrationId; 31 class BackgroundFetchRegistrationId;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 void DidCreateRegistration( 95 void DidCreateRegistration(
92 const BackgroundFetchRegistrationId& registration_id, 96 const BackgroundFetchRegistrationId& registration_id,
93 const BackgroundFetchOptions& options, 97 const BackgroundFetchOptions& options,
94 const blink::mojom::BackgroundFetchService::FetchCallback& callback, 98 const blink::mojom::BackgroundFetchService::FetchCallback& callback,
95 blink::mojom::BackgroundFetchError error, 99 blink::mojom::BackgroundFetchError error,
96 std::vector<BackgroundFetchRequestInfo> initial_requests); 100 std::vector<BackgroundFetchRequestInfo> initial_requests);
97 101
98 // Called when a the given |controller| has finished processing its job. 102 // Called when a the given |controller| has finished processing its job.
99 void DidCompleteJob(BackgroundFetchJobController* controller); 103 void DidCompleteJob(BackgroundFetchJobController* controller);
100 104
101 // |this| is owned by the BrowserContext via the StoragePartitionImpl. 105 // |this| is owned, indirectly, by the BrowserContext.
102 BrowserContext* browser_context_; 106 BrowserContext* browser_context_;
103 StoragePartitionImpl* storage_partition_;
104 107
105 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; 108 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
109 scoped_refptr<net::URLRequestContextGetter> request_context_;
110
106 std::unique_ptr<BackgroundFetchDataManager> background_fetch_data_manager_; 111 std::unique_ptr<BackgroundFetchDataManager> background_fetch_data_manager_;
107 112
108 // Map of the Background Fetch fetches that are currently in-progress. 113 // Map of the Background Fetch fetches that are currently in-progress.
109 std::map<BackgroundFetchRegistrationId, 114 std::map<BackgroundFetchRegistrationId,
110 std::unique_ptr<BackgroundFetchJobController>> 115 std::unique_ptr<BackgroundFetchJobController>>
111 active_fetches_; 116 active_fetches_;
112 117
113 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); 118 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext);
114 }; 119 };
115 120
116 } // namespace content 121 } // namespace content
117 122
118 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ 123 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/background_fetch/background_fetch_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698