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

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

Issue 2762573003: Implement BackgroundFetchManager.fetch() and struct traits (Closed)
Patch Set: First round of comments 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/BackgroundFetchRegistration.cpp
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchRegistration.cpp b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchRegistration.cpp
index 3350cd57ce2b589a602f85d5595a9e19210a92ec..f6d2edf3b036eaafd7191ebea9b3374c394c5912 100644
--- a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchRegistration.cpp
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchRegistration.cpp
@@ -12,19 +12,22 @@
namespace blink {
BackgroundFetchRegistration::BackgroundFetchRegistration(
- ServiceWorkerRegistration* registration,
String tag,
HeapVector<IconDefinition> icons,
long long totalDownloadSize,
String title)
- : m_registration(registration),
- m_tag(tag),
+ : m_tag(tag),
m_icons(icons),
m_totalDownloadSize(totalDownloadSize),
m_title(title) {}
BackgroundFetchRegistration::~BackgroundFetchRegistration() = default;
+void BackgroundFetchRegistration::setServiceWorkerRegistration(
+ ServiceWorkerRegistration* registration) {
+ m_registration = registration;
dcheng 2017/03/24 23:12:24 Maybe DCHECK(!m_registration) first as well.
Peter Beverloo 2017/03/24 23:26:05 Sure, I'll send you a follow-up either tomorrow or
+}
+
String BackgroundFetchRegistration::tag() const {
return m_tag;
}
@@ -45,6 +48,7 @@ ScriptPromise BackgroundFetchRegistration::abort(ScriptState* scriptState) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
+ DCHECK(m_registration);
BackgroundFetchBridge::from(m_registration)
->abort(m_tag, WTF::bind(&BackgroundFetchRegistration::didAbort,
wrapPersistent(this), wrapPersistent(resolver)));

Powered by Google App Engine
This is Rietveld 408576698