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

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

Issue 2745543002: Implement BackgroundFetchManager::{get, fetch}() (Closed)
Patch Set: more webexposed tests 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
new file mode 100644
index 0000000000000000000000000000000000000000..0a7aefe160c715595eda47b993d0264856bb98c1
--- /dev/null
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchRegistration.cpp
@@ -0,0 +1,52 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "modules/background_fetch/BackgroundFetchRegistration.h"
+
+#include "modules/background_fetch/IconDefinition.h"
+#include "modules/serviceworkers/ServiceWorkerRegistration.h"
+
+namespace blink {
+
+BackgroundFetchRegistration::BackgroundFetchRegistration(
+ ServiceWorkerRegistration* registration,
+ String tag,
+ HeapVector<IconDefinition> icons,
+ long long totalDownloadSize,
+ String title)
+ : m_registration(registration),
+ m_tag(tag),
+ m_icons(icons),
+ m_totalDownloadSize(totalDownloadSize),
+ m_title(title) {}
+
+BackgroundFetchRegistration::~BackgroundFetchRegistration() = default;
+
+String BackgroundFetchRegistration::tag() const {
+ return m_tag;
+}
+
+HeapVector<IconDefinition> BackgroundFetchRegistration::icons() const {
+ return m_icons;
+}
+
+long long BackgroundFetchRegistration::totalDownloadSize() const {
+ return m_totalDownloadSize;
+}
+
+String BackgroundFetchRegistration::title() const {
+ return m_title;
+}
+
+void BackgroundFetchRegistration::abort() {
+ // TODO(peter): Implement the ability to abort the active background fetch
+ // for the |m_registration| identified by the |m_tag|.
+}
+
+DEFINE_TRACE(BackgroundFetchRegistration) {
+ visitor->trace(m_registration);
+ visitor->trace(m_icons);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698