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

Unified Diff: content/browser/background_fetch/background_fetch_data_manager.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 side-by-side diff with in-line comments
Download patch
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
index c59f77c793819680686322eddd633abc73bdae31..0e9acd65e0fe9a8dec7517b18b093c10feb64a93 100644
--- a/content/browser/background_fetch/background_fetch_data_manager.h
+++ b/content/browser/background_fetch/background_fetch_data_manager.h
@@ -14,13 +14,13 @@
#include "base/macros.h"
#include "base/optional.h"
#include "content/browser/background_fetch/background_fetch_registration_id.h"
-#include "content/browser/background_fetch/background_fetch_request_info.h"
#include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom.h"
#include "url/origin.h"
namespace content {
+class BackgroundFetchRequestInfo;
struct BackgroundFetchSettledFetch;
class BlobHandle;
class BrowserContext;
@@ -32,13 +32,13 @@ class ChromeBlobStorageContext;
// which will keep the metadata up to date.
class CONTENT_EXPORT BackgroundFetchDataManager {
public:
- using CreateRegistrationCallback =
- base::OnceCallback<void(blink::mojom::BackgroundFetchError,
- std::vector<BackgroundFetchRequestInfo>)>;
+ using CreateRegistrationCallback = base::OnceCallback<void(
+ blink::mojom::BackgroundFetchError,
+ std::vector<scoped_refptr<BackgroundFetchRequestInfo>>)>;
using DeleteRegistrationCallback =
base::OnceCallback<void(blink::mojom::BackgroundFetchError)>;
- using NextRequestCallback = base::OnceCallback<void(
- const base::Optional<BackgroundFetchRequestInfo>&)>;
+ using NextRequestCallback =
+ base::OnceCallback<void(scoped_refptr<BackgroundFetchRequestInfo>)>;
using SettledFetchesCallback =
base::OnceCallback<void(blink::mojom::BackgroundFetchError,
std::vector<BackgroundFetchSettledFetch>,
@@ -60,7 +60,7 @@ class CONTENT_EXPORT BackgroundFetchDataManager {
// |registration_id|, has been started as |download_guid|.
void MarkRequestAsStarted(
const BackgroundFetchRegistrationId& registration_id,
- const BackgroundFetchRequestInfo& request,
+ BackgroundFetchRequestInfo* request,
const std::string& download_guid);
// Marks that the |request|, part of the Background Fetch identified by
@@ -68,7 +68,7 @@ class CONTENT_EXPORT BackgroundFetchDataManager {
// next request, if any, when the operation has completed.
void MarkRequestAsCompleteAndGetNextRequest(
const BackgroundFetchRegistrationId& registration_id,
- const BackgroundFetchRequestInfo& request,
+ BackgroundFetchRequestInfo* request,
NextRequestCallback callback);
// Reads all settled fetches for the given |registration_id|. Both the Request

Powered by Google App Engine
This is Rietveld 408576698