| 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> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <map> | 11 #include <map> |
| 9 #include <queue> | 12 #include <queue> |
| 10 | 13 |
| 11 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 12 #include "base/id_map.h" | 15 #include "base/id_map.h" |
| 16 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 14 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 15 #include "content/common/presentation/presentation_service.mojom.h" | 19 #include "content/common/presentation/presentation_service.mojom.h" |
| 16 #include "content/public/renderer/render_frame_observer.h" | 20 #include "content/public/renderer/render_frame_observer.h" |
| 17 #include "mojo/public/cpp/bindings/binding.h" | 21 #include "mojo/public/cpp/bindings/binding.h" |
| 18 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio
nClient.h" | 22 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio
nClient.h" |
| 19 | 23 |
| 20 namespace blink { | 24 namespace blink { |
| 21 class WebPresentationAvailabilityObserver; | 25 class WebPresentationAvailabilityObserver; |
| 22 class WebString; | 26 class WebString; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 static SendMessageRequest* CreateSendTextMessageRequest( | 51 static SendMessageRequest* CreateSendTextMessageRequest( |
| 48 const blink::WebString& presentationUrl, | 52 const blink::WebString& presentationUrl, |
| 49 const blink::WebString& presentationId, | 53 const blink::WebString& presentationId, |
| 50 const blink::WebString& message); | 54 const blink::WebString& message); |
| 51 static SendMessageRequest* CreateSendBinaryMessageRequest( | 55 static SendMessageRequest* CreateSendBinaryMessageRequest( |
| 52 const blink::WebString& presentationUrl, | 56 const blink::WebString& presentationUrl, |
| 53 const blink::WebString& presentationId, | 57 const blink::WebString& presentationId, |
| 54 presentation::PresentationMessageType type, | 58 presentation::PresentationMessageType type, |
| 55 const uint8* data, | 59 const uint8_t* data, |
| 56 size_t length); | 60 size_t length); |
| 57 | 61 |
| 58 // WebPresentationClient implementation. | 62 // WebPresentationClient implementation. |
| 59 void setController(blink::WebPresentationController* controller) override; | 63 void setController(blink::WebPresentationController* controller) override; |
| 60 void startSession( | 64 void startSession( |
| 61 const blink::WebString& presentationUrl, | 65 const blink::WebString& presentationUrl, |
| 62 blink::WebPresentationConnectionClientCallbacks* callback) override; | 66 blink::WebPresentationConnectionClientCallbacks* callback) override; |
| 63 void joinSession( | 67 void joinSession( |
| 64 const blink::WebString& presentationUrl, | 68 const blink::WebString& presentationUrl, |
| 65 const blink::WebString& presentationId, | 69 const blink::WebString& presentationId, |
| 66 blink::WebPresentationConnectionClientCallbacks* callback) override; | 70 blink::WebPresentationConnectionClientCallbacks* callback) override; |
| 67 void sendString(const blink::WebString& presentationUrl, | 71 void sendString(const blink::WebString& presentationUrl, |
| 68 const blink::WebString& presentationId, | 72 const blink::WebString& presentationId, |
| 69 const blink::WebString& message) override; | 73 const blink::WebString& message) override; |
| 70 void sendArrayBuffer(const blink::WebString& presentationUrl, | 74 void sendArrayBuffer(const blink::WebString& presentationUrl, |
| 71 const blink::WebString& presentationId, | 75 const blink::WebString& presentationId, |
| 72 const uint8* data, | 76 const uint8_t* data, |
| 73 size_t length) override; | 77 size_t length) override; |
| 74 void sendBlobData(const blink::WebString& presentationUrl, | 78 void sendBlobData(const blink::WebString& presentationUrl, |
| 75 const blink::WebString& presentationId, | 79 const blink::WebString& presentationId, |
| 76 const uint8* data, | 80 const uint8_t* data, |
| 77 size_t length) override; | 81 size_t length) override; |
| 78 void closeSession(const blink::WebString& presentationUrl, | 82 void closeSession(const blink::WebString& presentationUrl, |
| 79 const blink::WebString& presentationId) override; | 83 const blink::WebString& presentationId) override; |
| 80 void terminateSession(const blink::WebString& presentationUrl, | 84 void terminateSession(const blink::WebString& presentationUrl, |
| 81 const blink::WebString& presentationId) override; | 85 const blink::WebString& presentationId) override; |
| 82 void getAvailability( | 86 void getAvailability( |
| 83 const blink::WebString& availabilityUrl, | 87 const blink::WebString& availabilityUrl, |
| 84 blink::WebPresentationAvailabilityCallbacks* callbacks) override; | 88 blink::WebPresentationAvailabilityCallbacks* callbacks) override; |
| 85 void startListening(blink::WebPresentationAvailabilityObserver*) override; | 89 void startListening(blink::WebPresentationAvailabilityObserver*) override; |
| 86 void stopListening(blink::WebPresentationAvailabilityObserver*) override; | 90 void stopListening(blink::WebPresentationAvailabilityObserver*) override; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // Updates the listening state of availability for |status| and notifies the | 161 // Updates the listening state of availability for |status| and notifies the |
| 158 // client. | 162 // client. |
| 159 void UpdateListeningState(AvailabilityStatus* status); | 163 void UpdateListeningState(AvailabilityStatus* status); |
| 160 | 164 |
| 161 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher); | 165 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher); |
| 162 }; | 166 }; |
| 163 | 167 |
| 164 } // namespace content | 168 } // namespace content |
| 165 | 169 |
| 166 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | 170 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |
| OLD | NEW |