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 CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |
6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
| 11 #include <deque> |
11 #include <map> | 12 #include <map> |
12 #include <memory> | 13 #include <memory> |
13 #include <queue> | |
14 #include <set> | 14 #include <set> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
19 #include "base/id_map.h" | 19 #include "base/id_map.h" |
20 #include "base/macros.h" | 20 #include "base/macros.h" |
21 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
22 #include "content/public/common/presentation_session.h" | 22 #include "content/public/common/presentation_session.h" |
23 #include "content/public/renderer/render_frame_observer.h" | 23 #include "content/public/renderer/render_frame_observer.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 const blink::WebString& presentationId, | 122 const blink::WebString& presentationId, |
123 const uint8_t* data, | 123 const uint8_t* data, |
124 size_t length, | 124 size_t length, |
125 const blink::WebPresentationConnectionProxy* connection_proxy) override; | 125 const blink::WebPresentationConnectionProxy* connection_proxy) override; |
126 void sendBlobData( | 126 void sendBlobData( |
127 const blink::WebURL& presentationUrl, | 127 const blink::WebURL& presentationUrl, |
128 const blink::WebString& presentationId, | 128 const blink::WebString& presentationId, |
129 const uint8_t* data, | 129 const uint8_t* data, |
130 size_t length, | 130 size_t length, |
131 const blink::WebPresentationConnectionProxy* connection_proxy) override; | 131 const blink::WebPresentationConnectionProxy* connection_proxy) override; |
132 void closeSession(const blink::WebURL& presentationUrl, | 132 void closeSession( |
133 const blink::WebString& presentationId) override; | 133 const blink::WebURL& presentationUrl, |
| 134 const blink::WebString& presentationId, |
| 135 const blink::WebPresentationConnectionProxy* connection_proxy) override; |
134 void terminateSession(const blink::WebURL& presentationUrl, | 136 void terminateSession(const blink::WebURL& presentationUrl, |
135 const blink::WebString& presentationId) override; | 137 const blink::WebString& presentationId) override; |
136 void getAvailability( | 138 void getAvailability( |
137 const blink::WebVector<blink::WebURL>& availabilityUrls, | 139 const blink::WebVector<blink::WebURL>& availabilityUrls, |
138 std::unique_ptr<blink::WebPresentationAvailabilityCallbacks> callbacks) | 140 std::unique_ptr<blink::WebPresentationAvailabilityCallbacks> callbacks) |
139 override; | 141 override; |
140 void startListening(blink::WebPresentationAvailabilityObserver*) override; | 142 void startListening(blink::WebPresentationAvailabilityObserver*) override; |
141 void stopListening(blink::WebPresentationAvailabilityObserver*) override; | 143 void stopListening(blink::WebPresentationAvailabilityObserver*) override; |
142 void setDefaultPresentationUrls( | 144 void setDefaultPresentationUrls( |
143 const blink::WebVector<blink::WebURL>& presentationUrls) override; | 145 const blink::WebVector<blink::WebURL>& presentationUrls) override; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 void UpdateListeningState(); | 196 void UpdateListeningState(); |
195 | 197 |
196 // Used as a weak reference. Can be null since lifetime is bound to the frame. | 198 // Used as a weak reference. Can be null since lifetime is bound to the frame. |
197 blink::WebPresentationController* controller_; | 199 blink::WebPresentationController* controller_; |
198 blink::WebPresentationReceiver* receiver_; | 200 blink::WebPresentationReceiver* receiver_; |
199 blink::mojom::PresentationServicePtr presentation_service_; | 201 blink::mojom::PresentationServicePtr presentation_service_; |
200 mojo::Binding<blink::mojom::PresentationServiceClient> binding_; | 202 mojo::Binding<blink::mojom::PresentationServiceClient> binding_; |
201 | 203 |
202 // Message requests are queued here and only one message at a time is sent | 204 // Message requests are queued here and only one message at a time is sent |
203 // over mojo channel. | 205 // over mojo channel. |
204 using MessageRequestQueue = std::queue<std::unique_ptr<SendMessageRequest>>; | 206 using MessageRequestQueue = std::deque<std::unique_ptr<SendMessageRequest>>; |
205 MessageRequestQueue message_request_queue_; | 207 MessageRequestQueue message_request_queue_; |
206 | 208 |
207 enum class ListeningState { | 209 enum class ListeningState { |
208 INACTIVE, | 210 INACTIVE, |
209 WAITING, | 211 WAITING, |
210 ACTIVE, | 212 ACTIVE, |
211 }; | 213 }; |
212 | 214 |
213 // Do not change order or add new enum values. |GetScreenAvailability| impl | 215 // Do not change order or add new enum values. |GetScreenAvailability| impl |
214 // depends on the order of the enum values. | 216 // depends on the order of the enum values. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // Returns UNKNOWN if all urls in |urls| have screen availability | 279 // Returns UNKNOWN if all urls in |urls| have screen availability |
278 // UNKNOWN. | 280 // UNKNOWN. |
279 ScreenAvailability GetScreenAvailability(const std::vector<GURL>& urls) const; | 281 ScreenAvailability GetScreenAvailability(const std::vector<GURL>& urls) const; |
280 | 282 |
281 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher); | 283 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher); |
282 }; | 284 }; |
283 | 285 |
284 } // namespace content | 286 } // namespace content |
285 | 287 |
286 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | 288 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |
OLD | NEW |