| 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/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // url equals to one of |presentationUrls|, and state is not terminated. | 74 // url equals to one of |presentationUrls|, and state is not terminated. |
| 75 // Return null if such a connection does not exist. | 75 // Return null if such a connection does not exist. |
| 76 PresentationConnection* findExistingConnection( | 76 PresentationConnection* findExistingConnection( |
| 77 const blink::WebVector<blink::WebURL>& presentationUrls, | 77 const blink::WebVector<blink::WebURL>& presentationUrls, |
| 78 const blink::WebString& presentationId); | 78 const blink::WebString& presentationId); |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 PresentationController(LocalFrame&, WebPresentationClient*); | 81 PresentationController(LocalFrame&, WebPresentationClient*); |
| 82 | 82 |
| 83 // Implementation of ContextLifecycleObserver. | 83 // Implementation of ContextLifecycleObserver. |
| 84 void contextDestroyed() override; | 84 void contextDestroyed(ExecutionContext*) override; |
| 85 | 85 |
| 86 // Return the connection associated with the given |connectionClient| or | 86 // Return the connection associated with the given |connectionClient| or |
| 87 // null if it doesn't exist. | 87 // null if it doesn't exist. |
| 88 PresentationConnection* findConnection(const WebPresentationSessionInfo&); | 88 PresentationConnection* findConnection(const WebPresentationSessionInfo&); |
| 89 | 89 |
| 90 // The WebPresentationClient which allows communicating with the embedder. | 90 // The WebPresentationClient which allows communicating with the embedder. |
| 91 // It is not owned by the PresentationController but the controller will | 91 // It is not owned by the PresentationController but the controller will |
| 92 // set it to null when the LocalFrame will be detached at which point the | 92 // set it to null when the LocalFrame will be detached at which point the |
| 93 // client can't be used. | 93 // client can't be used. |
| 94 WebPresentationClient* m_client; | 94 WebPresentationClient* m_client; |
| 95 | 95 |
| 96 // Default PresentationRequest used by the embedder. | 96 // Default PresentationRequest used by the embedder. |
| 97 // Member<PresentationRequest> m_defaultRequest; | 97 // Member<PresentationRequest> m_defaultRequest; |
| 98 WeakMember<Presentation> m_presentation; | 98 WeakMember<Presentation> m_presentation; |
| 99 | 99 |
| 100 // The presentation connections associated with that frame. | 100 // The presentation connections associated with that frame. |
| 101 // TODO(mlamouri): the PresentationController will keep any created | 101 // TODO(mlamouri): the PresentationController will keep any created |
| 102 // connections alive until the frame is detached. These should be weak ptr | 102 // connections alive until the frame is detached. These should be weak ptr |
| 103 // so that the connection can be GC'd. | 103 // so that the connection can be GC'd. |
| 104 HeapHashSet<Member<PresentationConnection>> m_connections; | 104 HeapHashSet<Member<PresentationConnection>> m_connections; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| 108 | 108 |
| 109 #endif // PresentationController_h | 109 #endif // PresentationController_h |
| OLD | NEW |