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

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: rebased. layout test update. Created 5 years, 5 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::didReceiveSessionBinaryMessage(WebPresentationSessi onClient* sessionClient, const uint8_t* data, size_t length)
106 {
107 if (m_presentation)
108 m_presentation->didReceiveSessionBinaryMessage(sessionClient, data, leng th);
109 else
110 PresentationSession::dispose(sessionClient);
mark a. foltz 2015/07/06 21:19:45 Please refactor to use the form suggested in https
USE s.singapati at gmail.com 2015/07/07 15:00:33 Done.
111 }
112
105 void PresentationController::startSession(const String& presentationUrl, const S tring& presentationId, WebPresentationSessionClientCallbacks* callbacks) 113 void PresentationController::startSession(const String& presentationUrl, const S tring& presentationId, WebPresentationSessionClientCallbacks* callbacks)
106 { 114 {
107 if (!m_client) { 115 if (!m_client) {
108 delete callbacks; 116 delete callbacks;
109 return; 117 return;
110 } 118 }
111 m_client->startSession(presentationUrl, presentationId, callbacks); 119 m_client->startSession(presentationUrl, presentationId, callbacks);
112 } 120 }
113 121
114 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks) 122 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 163
156 void PresentationController::willDetachFrameHost() 164 void PresentationController::willDetachFrameHost()
157 { 165 {
158 if (m_client) { 166 if (m_client) {
159 m_client->setController(nullptr); 167 m_client->setController(nullptr);
160 m_client = nullptr; 168 m_client = nullptr;
161 } 169 }
162 } 170 }
163 171
164 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698