| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PushController_h | 5 #ifndef PushController_h |
| 6 #define PushController_h | 6 #define PushController_h |
| 7 | 7 |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
| 10 #include "platform/Supplementable.h" | 10 #include "platform/Supplementable.h" |
| 11 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
| 12 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
| 13 #include "wtf/PassOwnPtr.h" | 13 #include "wtf/PassOwnPtr.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class WebPushClient; | 17 class WebPushClient; |
| 18 | 18 |
| 19 class PushController final : public NoBaseWillBeGarbageCollected<PushController>
, public WillBeHeapSupplement<LocalFrame> { | 19 class PushController final : public NoBaseWillBeGarbageCollected<PushController>
, public WillBeHeapSupplement<LocalFrame> { |
| 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PushController); | 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PushController); |
| 21 WTF_MAKE_NONCOPYABLE(PushController); | 21 WTF_MAKE_NONCOPYABLE(PushController); |
| 22 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(PushController); |
| 22 | 23 |
| 23 public: | 24 public: |
| 24 static PassOwnPtrWillBeRawPtr<PushController> create(WebPushClient*); | 25 static PassOwnPtrWillBeRawPtr<PushController> create(WebPushClient*); |
| 25 static const char* supplementName(); | 26 static const char* supplementName(); |
| 26 static PushController* from(LocalFrame* frame) { return static_cast<PushCont
roller*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); } | 27 static PushController* from(LocalFrame* frame) { return static_cast<PushCont
roller*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); } |
| 27 static WebPushClient& clientFrom(LocalFrame*); | 28 static WebPushClient& clientFrom(LocalFrame*); |
| 28 | 29 |
| 29 DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<LocalFrame>::trace(visi
tor); } | 30 DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<LocalFrame>::trace(visi
tor); } |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 explicit PushController(WebPushClient*); | 33 explicit PushController(WebPushClient*); |
| 33 | 34 |
| 34 WebPushClient* client() const { return m_client; } | 35 WebPushClient* client() const { return m_client; } |
| 35 | 36 |
| 36 WebPushClient* m_client; | 37 WebPushClient* m_client; |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 MODULES_EXPORT void providePushControllerTo(LocalFrame&, WebPushClient*); | 40 MODULES_EXPORT void providePushControllerTo(LocalFrame&, WebPushClient*); |
| 40 | 41 |
| 41 } // namespace blink | 42 } // namespace blink |
| 42 | 43 |
| 43 #endif // PushController_h | 44 #endif // PushController_h |
| OLD | NEW |