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

Unified Diff: content/browser/background_fetch/background_fetch_service_impl.cc

Issue 2762303002: Enable transmitting Fetch Requests over Mojo (Closed)
Patch Set: Enable transmitting Fetch Requests over Mojo 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
« no previous file with comments | « content/browser/background_fetch/background_fetch_service_impl.h ('k') | content/common/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/background_fetch/background_fetch_service_impl.cc
diff --git a/content/browser/background_fetch/background_fetch_service_impl.cc b/content/browser/background_fetch/background_fetch_service_impl.cc
index c15a5de62d1857b9979b4ab3d726ff57004cab92..dd5a5423c941776646ae60448863123d2f0d3587 100644
--- a/content/browser/background_fetch/background_fetch_service_impl.cc
+++ b/content/browser/background_fetch/background_fetch_service_impl.cc
@@ -12,6 +12,7 @@
#include "content/browser/bad_message.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/common/background_fetch/background_fetch_types.h"
+#include "content/common/service_worker/service_worker_types.h"
#include "content/public/browser/browser_thread.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "url/origin.h"
@@ -50,11 +51,13 @@ BackgroundFetchServiceImpl::BackgroundFetchServiceImpl(
BackgroundFetchServiceImpl::~BackgroundFetchServiceImpl() = default;
-void BackgroundFetchServiceImpl::Fetch(int64_t service_worker_registration_id,
- const url::Origin& origin,
- const std::string& tag,
- const BackgroundFetchOptions& options,
- const FetchCallback& callback) {
+void BackgroundFetchServiceImpl::Fetch(
+ int64_t service_worker_registration_id,
+ const url::Origin& origin,
+ const std::string& tag,
+ const std::vector<ServiceWorkerFetchRequest>& requests,
+ const BackgroundFetchOptions& options,
+ const FetchCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!ValidateTag(tag)) {
callback.Run(blink::mojom::BackgroundFetchError::INVALID_ARGUMENT,
@@ -62,21 +65,15 @@ void BackgroundFetchServiceImpl::Fetch(int64_t service_worker_registration_id,
return;
}
- BackgroundFetchRegistrationId registration_id(service_worker_registration_id,
- origin, tag);
-
- // TODO(peter): Remove once https://codereview.chromium.org/2762303002/ lands.
- std::vector<ServiceWorkerFetchRequest> requests;
- requests.emplace_back(GURL("https://example.com/image.png"), "POST",
- ServiceWorkerHeaderMap(), Referrer(),
- false /* is_reload */);
-
if (!ValidateRequests(requests)) {
callback.Run(blink::mojom::BackgroundFetchError::INVALID_ARGUMENT,
base::nullopt /* registration */);
return;
}
+ BackgroundFetchRegistrationId registration_id(service_worker_registration_id,
+ origin, tag);
+
background_fetch_context_->StartFetch(registration_id, requests, options,
callback);
}
« no previous file with comments | « content/browser/background_fetch/background_fetch_service_impl.h ('k') | content/common/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698