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

Unified Diff: content/browser/background_fetch/background_fetch_job_response_data.h

Issue 2774263003: Added ServiceWorkerResponses to GetJobResponse callback (Closed)
Patch Set: Move PostTask to correct thread Created 3 years, 9 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_job_response_data.h
diff --git a/content/browser/background_fetch/background_fetch_job_response_data.h b/content/browser/background_fetch/background_fetch_job_response_data.h
index 107707cb42e5682a4d68dd1af6118fb76fba71ab..280aa057e0e3623d5ecc13fc91b5ee4128691caa 100644
--- a/content/browser/background_fetch/background_fetch_job_response_data.h
+++ b/content/browser/background_fetch/background_fetch_job_response_data.h
@@ -12,12 +12,17 @@
#include "base/callback.h"
#include "base/callback_forward.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
+#include "content/common/service_worker/service_worker_types.h"
#include "content/public/browser/blob_handle.h"
namespace content {
+class BackgroundFetchRequestInfo;
+
using BackgroundFetchResponseCompleteCallback =
- base::Callback<void(std::vector<std::unique_ptr<BlobHandle>>)>;
+ base::Callback<void(std::vector<ServiceWorkerResponse>,
+ std::vector<std::unique_ptr<BlobHandle>>)>;
// Temporary holding class to aggregate the response data for requests
// associated with a given BackgroundFetch job.
@@ -28,11 +33,13 @@ class BackgroundFetchJobResponseData {
const BackgroundFetchResponseCompleteCallback& completion_callback);
~BackgroundFetchJobResponseData();
- void AddResponse(int request_num, std::unique_ptr<BlobHandle> response);
+ void AddResponse(const BackgroundFetchRequestInfo& request_info,
+ std::unique_ptr<BlobHandle> response);
bool IsComplete();
private:
std::vector<std::unique_ptr<BlobHandle>> blobs_;
+ std::vector<ServiceWorkerResponse> responses_;
size_t num_requests_ = 0;
size_t completed_requests_ = 0;
const std::string job_guid_;

Powered by Google App Engine
This is Rietveld 408576698