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

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

Issue 2736943002: Exposing new BackgroundFetchManager on SWReg
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/BackgroundFetchManager.h
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.h b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.h
new file mode 100644
index 0000000000000000000000000000000000000000..daff0c8a7ecc70761ea58ed5b5936fd6ab6aa084
--- /dev/null
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.h
@@ -0,0 +1,42 @@
+// 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 BackgroundFetchManager_h
+#define BackgroundFetchManager_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "platform/Supplementable.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class ServiceWorkerRegistration;
+
+class BackgroundFetchManager final
+ : public GarbageCollectedFinalized<BackgroundFetchManager>,
+ public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+
+ public:
+ static BackgroundFetchManager* create(
+ ServiceWorkerRegistration* registration) {
+ return new BackgroundFetchManager(registration);
+ }
+
+ // Implementation of the Background Fetch API interface.
+ // TODO(awdf) Should have fetch, get and getTags methods, not tag field.
+ const String& tag() const { return m_tag; }
+
+ DECLARE_TRACE();
+
+ private:
+ explicit BackgroundFetchManager(ServiceWorkerRegistration*);
+
+ Member<ServiceWorkerRegistration> m_registration;
+ String m_tag;
+};
+
+} // namespace blink
+
+#endif // BackgroundFetchManager_h

Powered by Google App Engine
This is Rietveld 408576698