Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Side by Side Diff: Source/modules/presentation/PresentationController.cpp

Issue 1206513004: [PresentationAPI] on-session-message handler for binary messages (Blink side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "config.h" 5 #include "config.h"
6 #include "modules/presentation/PresentationController.h" 6 #include "modules/presentation/PresentationController.h"
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "modules/presentation/PresentationSession.h" 9 #include "modules/presentation/PresentationSession.h"
10 #include "public/platform/modules/presentation/WebPresentationClient.h" 10 #include "public/platform/modules/presentation/WebPresentationClient.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 void PresentationController::didReceiveSessionTextMessage(WebPresentationSession Client* sessionClient, const WebString& message) 97 void PresentationController::didReceiveSessionTextMessage(WebPresentationSession Client* sessionClient, const WebString& message)
98 { 98 {
99 if (m_presentation) 99 if (m_presentation)
100 m_presentation->didReceiveSessionTextMessage(sessionClient, message); 100 m_presentation->didReceiveSessionTextMessage(sessionClient, message);
101 else 101 else
102 PresentationSession::dispose(sessionClient); 102 PresentationSession::dispose(sessionClient);
103 } 103 }
104 104
105 void PresentationController::didReceiveSessionArrayBufferMessage(WebPresentation SessionClient* sessionClient, const uint8_t* data, size_t length)
106 {
107 if (m_presentation)
108 m_presentation->didReceiveSessionArrayBufferMessage(sessionClient, data, length);
109 else
110 PresentationSession::dispose(sessionClient);
111 }
112
113 void PresentationController::didReceiveSessionBlobMessage(WebPresentationSession Client* sessionClient, const uint8_t* data, size_t length)
114 {
115 if (m_presentation)
116 m_presentation->didReceiveSessionBlobMessage(sessionClient, data, length );
117 else
118 PresentationSession::dispose(sessionClient);
119 }
120
105 void PresentationController::startSession(const String& presentationUrl, const S tring& presentationId, WebPresentationSessionClientCallbacks* callbacks) 121 void PresentationController::startSession(const String& presentationUrl, const S tring& presentationId, WebPresentationSessionClientCallbacks* callbacks)
106 { 122 {
107 if (!m_client) { 123 if (!m_client) {
108 delete callbacks; 124 delete callbacks;
109 return; 125 return;
110 } 126 }
111 m_client->startSession(presentationUrl, presentationId, callbacks); 127 m_client->startSession(presentationUrl, presentationId, callbacks);
112 } 128 }
113 129
114 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks) 130 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 171
156 void PresentationController::willDetachFrameHost() 172 void PresentationController::willDetachFrameHost()
157 { 173 {
158 if (m_client) { 174 if (m_client) {
159 m_client->setController(nullptr); 175 m_client->setController(nullptr);
160 m_client = nullptr; 176 m_client = nullptr;
161 } 177 }
162 } 178 }
163 179
164 } // namespace blink 180 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698