| 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 <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/id_map.h" | 12 #include "base/id_map.h" |
| 13 #include "base/memory/linked_ptr.h" | |
| 14 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 15 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 16 #include "content/common/presentation/presentation_service.mojom.h" | 15 #include "content/common/presentation/presentation_service.mojom.h" |
| 17 #include "content/public/renderer/render_frame_observer.h" | 16 #include "content/public/renderer/render_frame_observer.h" |
| 18 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
| 19 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio
nClient.h" | 18 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio
nClient.h" |
| 20 | 19 |
| 21 namespace blink { | 20 namespace blink { |
| 22 class WebPresentationAvailabilityObserver; | 21 class WebPresentationAvailabilityObserver; |
| 23 class WebString; | 22 class WebString; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 117 |
| 119 void UpdateListeningState(); | 118 void UpdateListeningState(); |
| 120 | 119 |
| 121 // Used as a weak reference. Can be null since lifetime is bound to the frame. | 120 // Used as a weak reference. Can be null since lifetime is bound to the frame. |
| 122 blink::WebPresentationController* controller_; | 121 blink::WebPresentationController* controller_; |
| 123 presentation::PresentationServicePtr presentation_service_; | 122 presentation::PresentationServicePtr presentation_service_; |
| 124 mojo::Binding<presentation::PresentationServiceClient> binding_; | 123 mojo::Binding<presentation::PresentationServiceClient> binding_; |
| 125 | 124 |
| 126 // Message requests are queued here and only one message at a time is sent | 125 // Message requests are queued here and only one message at a time is sent |
| 127 // over mojo channel. | 126 // over mojo channel. |
| 128 using MessageRequestQueue = std::queue<linked_ptr<SendMessageRequest>>; | 127 using MessageRequestQueue = std::queue<scoped_ptr<SendMessageRequest>>; |
| 129 MessageRequestQueue message_request_queue_; | 128 MessageRequestQueue message_request_queue_; |
| 130 | 129 |
| 131 enum class ListeningState { | 130 enum class ListeningState { |
| 132 INACTIVE, | 131 INACTIVE, |
| 133 WAITING, | 132 WAITING, |
| 134 ACTIVE, | 133 ACTIVE, |
| 135 }; | 134 }; |
| 136 | 135 |
| 137 using AvailabilityCallbacksMap = | 136 using AvailabilityCallbacksMap = |
| 138 IDMap<blink::WebPresentationAvailabilityCallbacks, IDMapOwnPointer>; | 137 IDMap<blink::WebPresentationAvailabilityCallbacks, IDMapOwnPointer>; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 156 // Updates the listening state of availability for |status| and notifies the | 155 // Updates the listening state of availability for |status| and notifies the |
| 157 // client. | 156 // client. |
| 158 void UpdateListeningState(AvailabilityStatus* status); | 157 void UpdateListeningState(AvailabilityStatus* status); |
| 159 | 158 |
| 160 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher); | 159 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher); |
| 161 }; | 160 }; |
| 162 | 161 |
| 163 } // namespace content | 162 } // namespace content |
| 164 | 163 |
| 165 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | 164 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |
| OLD | NEW |