Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / modules / push_messaging / PushEvent.h
blob514e2a6131dd04350fc68258c1947d40d9226e63
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PushEvent_h
6 #define PushEvent_h
8 #include "modules/EventModules.h"
9 #include "modules/ModulesExport.h"
10 #include "modules/push_messaging/PushMessageData.h"
11 #include "modules/serviceworkers/ExtendableEvent.h"
12 #include "platform/heap/Handle.h"
13 #include "wtf/text/AtomicString.h"
14 #include "wtf/text/WTFString.h"
16 namespace blink {
18 class PushEventInit;
20 class MODULES_EXPORT PushEvent final : public ExtendableEvent {
21 DEFINE_WRAPPERTYPEINFO();
22 public:
23 static PassRefPtrWillBeRawPtr<PushEvent> create()
25 return adoptRefWillBeNoop(new PushEvent);
27 static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, PushMessageData* data, WaitUntilObserver* observer)
29 return adoptRefWillBeNoop(new PushEvent(type, data, observer));
31 static PassRefPtrWillBeRawPtr<PushEvent> create(const AtomicString& type, const PushEventInit& initializer)
33 return adoptRefWillBeNoop(new PushEvent(type, initializer));
36 ~PushEvent() override;
38 const AtomicString& interfaceName() const override;
40 PushMessageData* data();
42 DECLARE_VIRTUAL_TRACE();
44 private:
45 PushEvent();
46 PushEvent(const AtomicString& type, PushMessageData*, WaitUntilObserver*);
47 PushEvent(const AtomicString& type, const PushEventInit&);
49 PersistentWillBeMember<PushMessageData> m_data;
52 } // namespace blink
54 #endif // PushEvent_h