| Index: content/browser/presentation/presentation_service_impl.cc
|
| diff --git a/content/browser/presentation/presentation_service_impl.cc b/content/browser/presentation/presentation_service_impl.cc
|
| index 916ddedd356548c9607c8a1ca4b26fba513c95ed..b1ecd6a57c7d011724e8505c9f598417dee175be 100644
|
| --- a/content/browser/presentation/presentation_service_impl.cc
|
| +++ b/content/browser/presentation/presentation_service_impl.cc
|
| @@ -49,6 +49,20 @@ presentation::SessionMessagePtr ToMojoSessionMessage(
|
| return output.Pass();
|
| }
|
|
|
| +content::PresentationMessageType GetMessageTypeFromMojo(
|
| + presentation::PresentationMessageType mojoPresentationMessageType) {
|
| + switch (mojoPresentationMessageType) {
|
| + case presentation::PRESENTATION_MESSAGE_TYPE_TEXT:
|
| + return content::PresentationMessageType::TEXT;
|
| + case presentation::PRESENTATION_MESSAGE_TYPE_ARRAY_BUFFER:
|
| + return content::PresentationMessageType::ARRAY_BUFFER;
|
| + case presentation::PRESENTATION_MESSAGE_TYPE_BLOB:
|
| + return content::PresentationMessageType::BLOB;
|
| + }
|
| + NOTREACHED();
|
| + return content::PresentationMessageType::ARRAY_BUFFER;
|
| +}
|
| +
|
| scoped_ptr<content::PresentationSessionMessage> GetPresentationSessionMessage(
|
| presentation::SessionMessagePtr input) {
|
| DCHECK(!input.is_null());
|
| @@ -67,8 +81,8 @@ scoped_ptr<content::PresentationSessionMessage> GetPresentationSessionMessage(
|
| make_scoped_ptr(new std::string));
|
| input->message.Swap(output->message.get());
|
|
|
| - } else if (input->type == presentation::PresentationMessageType::
|
| - PRESENTATION_MESSAGE_TYPE_ARRAY_BUFFER) {
|
| + } else {
|
| + // ArrayBuffer or Blob data.
|
| DCHECK(!input->data.is_null());
|
| DCHECK(input->message.is_null());
|
| // Return null PresentationSessionMessage if size exceeds.
|
| @@ -78,7 +92,8 @@ scoped_ptr<content::PresentationSessionMessage> GetPresentationSessionMessage(
|
| output = content::PresentationSessionMessage::CreateBinaryMessage(
|
| input->presentation_url,
|
| input->presentation_id,
|
| - make_scoped_ptr(new std::vector<uint8_t>));
|
| + make_scoped_ptr(new std::vector<uint8_t>),
|
| + GetMessageTypeFromMojo(input->type));
|
| input->data.Swap(output->data.get());
|
| }
|
|
|
|
|