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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void setPresentation(Presentation*); | 63 void setPresentation(Presentation*); |
64 | 64 |
65 // Called by the Presentation object when the default request is updated | 65 // Called by the Presentation object when the default request is updated |
66 // in order to notify the client about the change of default presentation | 66 // in order to notify the client about the change of default presentation |
67 // url. | 67 // url. |
68 void setDefaultRequestUrl(const KURL&); | 68 void setDefaultRequestUrl(const KURL&); |
69 | 69 |
70 // Handling of running connections. | 70 // Handling of running connections. |
71 void registerConnection(PresentationConnection*); | 71 void registerConnection(PresentationConnection*); |
72 | 72 |
| 73 // Return a connection in |m_connections| with id equals to |presentationId|, |
| 74 // url equals to one of |presentationUrls|, and state is not terminated. |
| 75 // Return null if such a connection does not exist. |
| 76 PresentationConnection* findExistingConnection( |
| 77 const blink::WebVector<blink::WebURL>& presentationUrls, |
| 78 const blink::WebString& presentationId); |
| 79 |
73 private: | 80 private: |
74 PresentationController(LocalFrame&, WebPresentationClient*); | 81 PresentationController(LocalFrame&, WebPresentationClient*); |
75 | 82 |
76 // Implementation of ContextLifecycleObserver. | 83 // Implementation of ContextLifecycleObserver. |
77 void contextDestroyed() override; | 84 void contextDestroyed() override; |
78 | 85 |
79 // Return the connection associated with the given |connectionClient| or | 86 // Return the connection associated with the given |connectionClient| or |
80 // null if it doesn't exist. | 87 // null if it doesn't exist. |
81 PresentationConnection* findConnection(const WebPresentationSessionInfo&); | 88 PresentationConnection* findConnection(const WebPresentationSessionInfo&); |
82 | 89 |
(...skipping 10 matching lines...) Expand all Loading... |
93 // The presentation connections associated with that frame. | 100 // The presentation connections associated with that frame. |
94 // TODO(mlamouri): the PresentationController will keep any created | 101 // TODO(mlamouri): the PresentationController will keep any created |
95 // 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 |
96 // so that the connection can be GC'd. | 103 // so that the connection can be GC'd. |
97 HeapHashSet<Member<PresentationConnection>> m_connections; | 104 HeapHashSet<Member<PresentationConnection>> m_connections; |
98 }; | 105 }; |
99 | 106 |
100 } // namespace blink | 107 } // namespace blink |
101 | 108 |
102 #endif // PresentationController_h | 109 #endif // PresentationController_h |
OLD | NEW |