Chromium Code Reviews| 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))); |