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

Unified Diff: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.cpp

Issue 2775923002: Add origins to the Background Fetch Mojo calls. (Closed)
Patch Set: 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: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.cpp
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.cpp b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.cpp
index a0b283e6cf0f7528beb7508bfed29ef2102e6436..b874f917722cc274d716cd650a62ffeb4058691a 100644
--- a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.cpp
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.cpp
@@ -52,7 +52,8 @@ void BackgroundFetchBridge::fetch(
std::unique_ptr<RegistrationCallback> callback) {
// TODO(peter): Include |requests| in the Mojo call.
getService()->Fetch(
- supplementable()->webRegistration()->registrationId(), tag,
+ supplementable()->webRegistration()->registrationId(),
+ getSecurityOrigin(), tag,
mojom::blink::BackgroundFetchOptions::From(options),
convertToBaseCallback(
WTF::bind(&BackgroundFetchBridge::didGetRegistration,
@@ -62,7 +63,8 @@ void BackgroundFetchBridge::fetch(
void BackgroundFetchBridge::abort(const String& tag,
std::unique_ptr<AbortCallback> callback) {
getService()->Abort(supplementable()->webRegistration()->registrationId(),
- tag, convertToBaseCallback(std::move(callback)));
+ getSecurityOrigin(), tag,
+ convertToBaseCallback(std::move(callback)));
}
void BackgroundFetchBridge::updateUI(
@@ -70,7 +72,7 @@ void BackgroundFetchBridge::updateUI(
const String& title,
std::unique_ptr<UpdateUICallback> callback) {
getService()->UpdateUI(supplementable()->webRegistration()->registrationId(),
- tag, title,
+ getSecurityOrigin(), tag, title,
convertToBaseCallback(std::move(callback)));
}
@@ -78,7 +80,8 @@ void BackgroundFetchBridge::getRegistration(
const String& tag,
std::unique_ptr<RegistrationCallback> callback) {
getService()->GetRegistration(
- supplementable()->webRegistration()->registrationId(), tag,
+ supplementable()->webRegistration()->registrationId(),
+ getSecurityOrigin(), tag,
convertToBaseCallback(
WTF::bind(&BackgroundFetchBridge::didGetRegistration,
wrapPersistent(this), WTF::passed(std::move(callback)))));
@@ -101,9 +104,14 @@ void BackgroundFetchBridge::didGetRegistration(
void BackgroundFetchBridge::getTags(std::unique_ptr<GetTagsCallback> callback) {
getService()->GetTags(supplementable()->webRegistration()->registrationId(),
+ getSecurityOrigin(),
convertToBaseCallback(std::move(callback)));
}
+SecurityOrigin* BackgroundFetchBridge::getSecurityOrigin() {
+ return supplementable()->getExecutionContext()->getSecurityOrigin();
+}
+
mojom::blink::BackgroundFetchServicePtr& BackgroundFetchBridge::getService() {
if (!m_backgroundFetchService) {
Platform::current()->interfaceProvider()->getInterface(

Powered by Google App Engine
This is Rietveld 408576698