Chromium Code Reviews| Index: content/renderer/presentation/presentation_dispatcher.h |
| diff --git a/content/renderer/presentation/presentation_dispatcher.h b/content/renderer/presentation/presentation_dispatcher.h |
| index 388adb5f3427e56124399e5b1b2a3f009943953d..c88d4d98813d0bdd6fcc8a72c08e84323dd8fdc8 100644 |
| --- a/content/renderer/presentation/presentation_dispatcher.h |
| +++ b/content/renderer/presentation/presentation_dispatcher.h |
| @@ -49,6 +49,9 @@ class CONTENT_EXPORT PresentationDispatcher |
| ~PresentationDispatcher() override; |
| private: |
| + // TODO(zhaobin): remove friend class after moving message queue logic |
| + // from PresentationDispatcher to PresentationConnectionProxy. |
| + friend class PresentationConnectionProxy; |
| friend class TestPresentationDispatcher; |
| FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestStartSession); |
| FRIEND_TEST_ALL_PREFIXES(PresentationDispatcherTest, TestStartSessionError); |
| @@ -65,47 +68,57 @@ class CONTENT_EXPORT PresentationDispatcher |
| TestSetDefaultPresentationUrls); |
| struct SendMessageRequest { |
| - SendMessageRequest(blink::mojom::PresentationSessionInfoPtr session_info, |
| - blink::mojom::ConnectionMessagePtr message); |
| + SendMessageRequest( |
| + blink::mojom::PresentationSessionInfoPtr session_info, |
| + blink::mojom::ConnectionMessagePtr message, |
| + const blink::WebPresentationConnectionProxy* connection_proxy); |
| ~SendMessageRequest(); |
| blink::mojom::PresentationSessionInfoPtr session_info; |
| blink::mojom::ConnectionMessagePtr message; |
| + const blink::WebPresentationConnectionProxy* connection_proxy; |
|
imcheng
2017/01/20 20:15:43
Is this used in this patch? Please document what t
zhaobin
2017/01/23 19:38:49
Done.
|
| }; |
| static SendMessageRequest* CreateSendTextMessageRequest( |
| const blink::WebURL& presentationUrl, |
| const blink::WebString& presentationId, |
| - const blink::WebString& message); |
| + const blink::WebString& message, |
| + const blink::WebPresentationConnectionProxy* connection_proxy); |
| static SendMessageRequest* CreateSendBinaryMessageRequest( |
| const blink::WebURL& presentationUrl, |
| const blink::WebString& presentationId, |
| blink::mojom::PresentationMessageType type, |
| const uint8_t* data, |
| - size_t length); |
| + size_t length, |
| + const blink::WebPresentationConnectionProxy* connection_proxy); |
| // WebPresentationClient implementation. |
| void setController(blink::WebPresentationController* controller) override; |
| void setReceiver(blink::WebPresentationReceiver*) override; |
| - |
| void startSession(const blink::WebVector<blink::WebURL>& presentationUrls, |
| - std::unique_ptr<blink::WebPresentationConnectionCallback> |
| + std::unique_ptr<blink::WebPresentationConnectionCallbacks> |
| callback) override; |
| void joinSession(const blink::WebVector<blink::WebURL>& presentationUrls, |
| const blink::WebString& presentationId, |
| - std::unique_ptr<blink::WebPresentationConnectionCallback> |
| + std::unique_ptr<blink::WebPresentationConnectionCallbacks> |
| callback) override; |
| - void sendString(const blink::WebURL& presentationUrl, |
| - const blink::WebString& presentationId, |
| - const blink::WebString& message) override; |
| - void sendArrayBuffer(const blink::WebURL& presentationUrl, |
| - const blink::WebString& presentationId, |
| - const uint8_t* data, |
| - size_t length) override; |
| - void sendBlobData(const blink::WebURL& presentationUrl, |
| - const blink::WebString& presentationId, |
| - const uint8_t* data, |
| - size_t length) override; |
| + void sendString( |
| + const blink::WebURL& presentationUrl, |
| + const blink::WebString& presentationId, |
| + const blink::WebString& message, |
| + const blink::WebPresentationConnectionProxy* connection_proxy) override; |
| + void sendArrayBuffer( |
| + const blink::WebURL& presentationUrl, |
| + const blink::WebString& presentationId, |
| + const uint8_t* data, |
| + size_t length, |
| + const blink::WebPresentationConnectionProxy* connection_proxy) override; |
| + void sendBlobData( |
| + const blink::WebURL& presentationUrl, |
| + const blink::WebString& presentationId, |
| + const uint8_t* data, |
| + size_t length, |
| + const blink::WebPresentationConnectionProxy* connection_proxy) override; |
| void closeSession(const blink::WebURL& presentationUrl, |
| const blink::WebString& presentationId) override; |
| void terminateSession(const blink::WebURL& presentationUrl, |
| @@ -142,7 +155,7 @@ class CONTENT_EXPORT PresentationDispatcher |
| blink::mojom::PresentationSessionInfoPtr session_info) override; |
| void OnSessionCreated( |
| - std::unique_ptr<blink::WebPresentationConnectionCallback> callback, |
| + std::unique_ptr<blink::WebPresentationConnectionCallbacks> callback, |
| blink::mojom::PresentationSessionInfoPtr session_info, |
| blink::mojom::PresentationErrorPtr error); |
| void OnReceiverConnectionAvailable( |