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

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

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.h
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchRegistration.h b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchRegistration.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc9edc321b4fbe9323ab618030051efd9054dfb2
--- /dev/null
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchRegistration.h
@@ -0,0 +1,54 @@
+// 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.
+
+#ifndef BackgroundFetchRegistration_h
+#define BackgroundFetchRegistration_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "platform/heap/GarbageCollected.h"
+#include "platform/heap/Handle.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class IconDefinition;
+class ServiceWorkerRegistration;
+
+// Represents an individual Background Fetch registration. Gives developers
+// access to its properties, options, and enables them to abort the fetch.
+class BackgroundFetchRegistration final
+ : public GarbageCollectedFinalized<BackgroundFetchRegistration>,
+ public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+
+ public:
+ BackgroundFetchRegistration(ServiceWorkerRegistration*,
+ String tag,
+ HeapVector<IconDefinition> icons,
+ long long totalDownloadSize,
+ String title);
+ ~BackgroundFetchRegistration();
+
+ String tag() const;
+ HeapVector<IconDefinition> icons() const;
+ long long totalDownloadSize() const;
+ String title() const;
+
+ void abort();
+
+ DECLARE_TRACE();
+
+ private:
+ Member<ServiceWorkerRegistration> m_registration;
+
+ String m_tag;
+ HeapVector<IconDefinition> m_icons;
+ long long m_totalDownloadSize;
+ String m_title;
+};
+
+} // namespace blink
+
+#endif // BackgroundFetchRegistration_h

Powered by Google App Engine
This is Rietveld 408576698