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

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

Issue 2796933003: Store BackgroundFetchRequestInfo in a refcounted pointer (Closed)
Patch Set: 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>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 ~BackgroundFetchContext(); 83 ~BackgroundFetchContext();
84 84
85 // Shuts down the active Job Controllers on the IO thread. 85 // Shuts down the active Job Controllers on the IO thread.
86 void ShutdownOnIO(); 86 void ShutdownOnIO();
87 87
88 // Creates a new Job Controller for the given |registration_id| and |options|, 88 // Creates a new Job Controller for the given |registration_id| and |options|,
89 // which will start fetching the files that are part of the registration. 89 // which will start fetching the files that are part of the registration.
90 void CreateController( 90 void CreateController(
91 const BackgroundFetchRegistrationId& registration_id, 91 const BackgroundFetchRegistrationId& registration_id,
92 const BackgroundFetchOptions& options, 92 const BackgroundFetchOptions& options,
93 std::vector<BackgroundFetchRequestInfo> initial_requests); 93 std::vector<scoped_refptr<BackgroundFetchRequestInfo>> initial_requests);
94 94
95 // Called when a new registration has been created by the data manager. 95 // Called when a new registration has been created by the data manager.
96 void DidCreateRegistration( 96 void DidCreateRegistration(
97 const BackgroundFetchRegistrationId& registration_id, 97 const BackgroundFetchRegistrationId& registration_id,
98 const BackgroundFetchOptions& options, 98 const BackgroundFetchOptions& options,
99 const blink::mojom::BackgroundFetchService::FetchCallback& callback, 99 const blink::mojom::BackgroundFetchService::FetchCallback& callback,
100 blink::mojom::BackgroundFetchError error, 100 blink::mojom::BackgroundFetchError error,
101 std::vector<BackgroundFetchRequestInfo> initial_requests); 101 std::vector<scoped_refptr<BackgroundFetchRequestInfo>> initial_requests);
102 102
103 // Called when the given |controller| has finished processing its job. 103 // Called when the given |controller| has finished processing its job.
104 void DidCompleteJob(BackgroundFetchJobController* controller); 104 void DidCompleteJob(BackgroundFetchJobController* controller);
105 105
106 // Called when the sequence of settled fetches for |registration_id| have been 106 // Called when the sequence of settled fetches for |registration_id| have been
107 // retrieved from storage, and the Service Worker event can be invoked. 107 // retrieved from storage, and the Service Worker event can be invoked.
108 void DidGetSettledFetches( 108 void DidGetSettledFetches(
109 const BackgroundFetchRegistrationId& registration_id, 109 const BackgroundFetchRegistrationId& registration_id,
110 blink::mojom::BackgroundFetchError error, 110 blink::mojom::BackgroundFetchError error,
111 std::vector<BackgroundFetchSettledFetch> settled_fetches, 111 std::vector<BackgroundFetchSettledFetch> settled_fetches,
(...skipping 15 matching lines...) Expand all
127 std::map<BackgroundFetchRegistrationId, 127 std::map<BackgroundFetchRegistrationId,
128 std::unique_ptr<BackgroundFetchJobController>> 128 std::unique_ptr<BackgroundFetchJobController>>
129 active_fetches_; 129 active_fetches_;
130 130
131 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); 131 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext);
132 }; 132 };
133 133
134 } // namespace content 134 } // namespace content
135 135
136 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ 136 #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