| 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 NoBaseWillBeGarbageCollectedFinalized<PresentationController> | 29 : public GarbageCollectedFinalized<PresentationController> |
| 30 , public WillBeHeapSupplement<LocalFrame> | 30 , public HeapSupplement<LocalFrame> |
| 31 , public LocalFrameLifecycleObserver | 31 , public LocalFrameLifecycleObserver |
| 32 , public WebPresentationController { | 32 , public WebPresentationController { |
| 33 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationController); | 33 USING_GARBAGE_COLLECTED_MIXIN(PresentationController); |
| 34 USING_FAST_MALLOC_WILL_BE_REMOVED(PresentationController); | |
| 35 WTF_MAKE_NONCOPYABLE(PresentationController); | 34 WTF_MAKE_NONCOPYABLE(PresentationController); |
| 36 public: | 35 public: |
| 37 ~PresentationController() override; | 36 ~PresentationController() override; |
| 38 | 37 |
| 39 static PassOwnPtrWillBeRawPtr<PresentationController> create(LocalFrame&, We
bPresentationClient*); | 38 static RawPtr<PresentationController> create(LocalFrame&, WebPresentationCli
ent*); |
| 40 | 39 |
| 41 static const char* supplementName(); | 40 static const char* supplementName(); |
| 42 static PresentationController* from(LocalFrame&); | 41 static PresentationController* from(LocalFrame&); |
| 43 | 42 |
| 44 static void provideTo(LocalFrame&, WebPresentationClient*); | 43 static void provideTo(LocalFrame&, WebPresentationClient*); |
| 45 | 44 |
| 46 WebPresentationClient* client(); | 45 WebPresentationClient* client(); |
| 47 | 46 |
| 48 // Implementation of HeapSupplement. | 47 // Implementation of HeapSupplement. |
| 49 DECLARE_VIRTUAL_TRACE(); | 48 DECLARE_VIRTUAL_TRACE(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 78 // null if it doesn't exist. | 77 // null if it doesn't exist. |
| 79 PresentationConnection* findConnection(WebPresentationConnectionClient*); | 78 PresentationConnection* findConnection(WebPresentationConnectionClient*); |
| 80 | 79 |
| 81 // The WebPresentationClient which allows communicating with the embedder. | 80 // The WebPresentationClient which allows communicating with the embedder. |
| 82 // It is not owned by the PresentationController but the controller will | 81 // It is not owned by the PresentationController but the controller will |
| 83 // set it to null when the LocalFrame will be detached at which point the | 82 // set it to null when the LocalFrame will be detached at which point the |
| 84 // client can't be used. | 83 // client can't be used. |
| 85 WebPresentationClient* m_client; | 84 WebPresentationClient* m_client; |
| 86 | 85 |
| 87 // Default PresentationRequest used by the embedder. | 86 // Default PresentationRequest used by the embedder. |
| 88 // PersistentWillBeMember<PresentationRequest> m_defaultRequest; | 87 // Member<PresentationRequest> m_defaultRequest; |
| 89 WeakMember<Presentation> m_presentation; | 88 WeakMember<Presentation> m_presentation; |
| 90 | 89 |
| 91 // The presentation connections associated with that frame. | 90 // The presentation connections associated with that frame. |
| 92 // TODO(mlamouri): the PresentationController will keep any created | 91 // TODO(mlamouri): the PresentationController will keep any created |
| 93 // 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 |
| 94 // so that the connection can be GC'd. | 93 // so that the connection can be GC'd. |
| 95 PersistentHeapHashSetWillBeHeapHashSet<Member<PresentationConnection>> m_con
nections; | 94 HeapHashSet<Member<PresentationConnection>> m_connections; |
| 96 }; | 95 }; |
| 97 | 96 |
| 98 } // namespace blink | 97 } // namespace blink |
| 99 | 98 |
| 100 #endif // PresentationController_h | 99 #endif // PresentationController_h |
| OLD | NEW |