| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 PresentationController_h | 5 #ifndef PresentationController_h |
| 6 #define PresentationController_h | 6 #define PresentationController_h |
| 7 | 7 |
| 8 #include "core/frame/LocalFrameLifecycleObserver.h" | 8 #include "core/frame/LocalFrameLifecycleObserver.h" |
| 9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
| 10 #include "modules/presentation/Presentation.h" | 10 #include "modules/presentation/Presentation.h" |
| 11 #include "modules/presentation/PresentationRequest.h" | 11 #include "modules/presentation/PresentationRequest.h" |
| 12 #include "platform/Supplementable.h" | 12 #include "platform/Supplementable.h" |
| 13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 14 #include "public/platform/modules/presentation/WebPresentationClient.h" | 14 #include "public/platform/modules/presentation/WebPresentationClient.h" |
| 15 #include "public/platform/modules/presentation/WebPresentationController.h" | 15 #include "public/platform/modules/presentation/WebPresentationController.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class LocalFrame; | 19 class LocalFrame; |
| 20 class PresentationConnection; | 20 class PresentationConnection; |
| 21 class WebPresentationAvailabilityCallback; | 21 class WebPresentationAvailabilityCallback; |
| 22 class WebPresentationConnectionClient; | 22 class WebPresentationConnectionClient; |
| 23 enum class WebPresentationConnectionCloseReason; | 23 enum class WebPresentationConnectionCloseReason; |
| 24 enum class WebPresentationConnectionState; | 24 enum class WebPresentationConnectionState; |
| 25 | 25 |
| 26 // The coordinator between the various page exposed properties and the content | 26 // The coordinator between the various page exposed properties and the content |
| 27 // layer represented via |WebPresentationClient|. | 27 // layer represented via |WebPresentationClient|. |
| 28 class MODULES_EXPORT PresentationController final | 28 class MODULES_EXPORT PresentationController final |
| 29 : public GarbageCollectedFinalized<PresentationController> | 29 : public GarbageCollectedFinalized<PresentationController> |
| 30 , public HeapSupplement<LocalFrame> | 30 , public Supplement<LocalFrame> |
| 31 , public LocalFrameLifecycleObserver | 31 , public LocalFrameLifecycleObserver |
| 32 , public WebPresentationController { | 32 , public WebPresentationController { |
| 33 USING_GARBAGE_COLLECTED_MIXIN(PresentationController); | 33 USING_GARBAGE_COLLECTED_MIXIN(PresentationController); |
| 34 WTF_MAKE_NONCOPYABLE(PresentationController); | 34 WTF_MAKE_NONCOPYABLE(PresentationController); |
| 35 public: | 35 public: |
| 36 ~PresentationController() override; | 36 ~PresentationController() override; |
| 37 | 37 |
| 38 static RawPtr<PresentationController> create(LocalFrame&, WebPresentationCli
ent*); | 38 static RawPtr<PresentationController> create(LocalFrame&, WebPresentationCli
ent*); |
| 39 | 39 |
| 40 static const char* supplementName(); | 40 static const char* supplementName(); |
| 41 static PresentationController* from(LocalFrame&); | 41 static PresentationController* from(LocalFrame&); |
| 42 | 42 |
| 43 static void provideTo(LocalFrame&, WebPresentationClient*); | 43 static void provideTo(LocalFrame&, WebPresentationClient*); |
| 44 | 44 |
| 45 WebPresentationClient* client(); | 45 WebPresentationClient* client(); |
| 46 | 46 |
| 47 // Implementation of HeapSupplement. | 47 // Implementation of Supplement. |
| 48 DECLARE_VIRTUAL_TRACE(); | 48 DECLARE_VIRTUAL_TRACE(); |
| 49 | 49 |
| 50 // Implementation of WebPresentationController. | 50 // Implementation of WebPresentationController. |
| 51 void didStartDefaultSession(WebPresentationConnectionClient*) override; | 51 void didStartDefaultSession(WebPresentationConnectionClient*) override; |
| 52 void didChangeSessionState(WebPresentationConnectionClient*, WebPresentation
ConnectionState) override; | 52 void didChangeSessionState(WebPresentationConnectionClient*, WebPresentation
ConnectionState) override; |
| 53 void didCloseConnection(WebPresentationConnectionClient*, WebPresentationCon
nectionCloseReason, const WebString& message) override; | 53 void didCloseConnection(WebPresentationConnectionClient*, WebPresentationCon
nectionCloseReason, const WebString& message) override; |
| 54 void didReceiveSessionTextMessage(WebPresentationConnectionClient*, const We
bString&) override; | 54 void didReceiveSessionTextMessage(WebPresentationConnectionClient*, const We
bString&) override; |
| 55 void didReceiveSessionBinaryMessage(WebPresentationConnectionClient*, const
uint8_t* data, size_t length) override; | 55 void didReceiveSessionBinaryMessage(WebPresentationConnectionClient*, const
uint8_t* data, size_t length) override; |
| 56 | 56 |
| 57 // Called by the Presentation object to advertize itself to the controller. | 57 // Called by the Presentation object to advertize itself to the controller. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // The presentation connections associated with that frame. | 90 // The presentation connections associated with that frame. |
| 91 // TODO(mlamouri): the PresentationController will keep any created | 91 // TODO(mlamouri): the PresentationController will keep any created |
| 92 // connections alive until the frame is detached. These should be weak ptr | 92 // connections alive until the frame is detached. These should be weak ptr |
| 93 // so that the connection can be GC'd. | 93 // so that the connection can be GC'd. |
| 94 HeapHashSet<Member<PresentationConnection>> m_connections; | 94 HeapHashSet<Member<PresentationConnection>> m_connections; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace blink | 97 } // namespace blink |
| 98 | 98 |
| 99 #endif // PresentationController_h | 99 #endif // PresentationController_h |
| OLD | NEW |