Chromium Code Reviews| 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/page/Page.h" | 8 #include "core/page/Page.h" |
| 9 #include "platform/Supplementable.h" | 9 #include "platform/Supplementable.h" |
| 10 #include "wtf/Forward.h" | 10 #include "wtf/Forward.h" |
| 11 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
| 12 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 class WebPushClient; | 15 class WebPushClient; |
| 16 } // namespace blink | 16 } // namespace blink |
| 17 | 17 |
| 18 namespace WebCore { | 18 namespace WebCore { |
| 19 | 19 |
| 20 class PushController FINAL : public Supplement<Page> { | 20 class PushController FINAL : public NoBaseWillBeGarbageCollected<PushController> , public WillBeHeapSupplement<Page> { |
| 21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PushController); | |
| 21 WTF_MAKE_NONCOPYABLE(PushController); | 22 WTF_MAKE_NONCOPYABLE(PushController); |
| 22 | 23 |
| 23 public: | 24 public: |
| 24 virtual ~PushController(); | 25 static PassOwnPtrWillBeRawPtr<PushController> create(blink::WebPushClient*); |
|
haraken
2014/04/30 11:18:08
You can use DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOV
zerny-chromium
2014/04/30 11:46:53
ditto?
| |
| 25 | |
| 26 static PassOwnPtr<PushController> create(blink::WebPushClient*); | |
| 27 static const char* supplementName(); | 26 static const char* supplementName(); |
| 28 static PushController* from(Page* page) { return static_cast<PushController* >(Supplement<Page>::from(page, supplementName())); } | 27 static PushController* from(Page* page) { return static_cast<PushController* >(WillBeHeapSupplement<Page>::from(page, supplementName())); } |
| 29 static blink::WebPushClient* clientFrom(Page*); | 28 static blink::WebPushClient* clientFrom(Page*); |
| 30 | 29 |
| 31 blink::WebPushClient* client() const { return m_client; } | 30 blink::WebPushClient* client() const { return m_client; } |
| 32 | 31 |
| 33 virtual void trace(Visitor*) OVERRIDE { } | 32 virtual void trace(Visitor*) OVERRIDE { } |
| 34 | 33 |
| 35 private: | 34 private: |
| 36 explicit PushController(blink::WebPushClient*); | 35 explicit PushController(blink::WebPushClient*); |
| 37 | 36 |
| 38 blink::WebPushClient* m_client; | 37 blink::WebPushClient* m_client; |
| 39 }; | 38 }; |
| 40 | 39 |
| 41 void providePushControllerTo(Page&, blink::WebPushClient*); | 40 void providePushControllerTo(Page&, blink::WebPushClient*); |
| 42 | 41 |
| 43 } // namespace WebCore | 42 } // namespace WebCore |
| 44 | 43 |
| 45 #endif // PushController_h | 44 #endif // PushController_h |
| OLD | NEW |