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

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

Issue 1002293005: [PresentationAPI] Plumbing send() from PresentationSession IDL to platform/. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix layout test: change postMessage to send. Created 5 years, 8 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks) 106 void PresentationController::joinSession(const String& presentationUrl, const St ring& presentationId, WebPresentationSessionClientCallbacks* callbacks)
107 { 107 {
108 if (!m_client) { 108 if (!m_client) {
109 delete callbacks; 109 delete callbacks;
110 return; 110 return;
111 } 111 }
112 m_client->joinSession(presentationUrl, presentationId, callbacks); 112 m_client->joinSession(presentationUrl, presentationId, callbacks);
113 } 113 }
114 114
115 void PresentationController::send(const String& presentationUrl, const String& p resentationId, const String& message)
116 {
117 if (!m_client)
118 return;
119 m_client->sendString(presentationUrl, presentationId, message);
120 }
121
122 void PresentationController::send(const String& presentationUrl, const String& p resentationId, const uint8_t* data, size_t length)
123 {
124 if (!m_client)
125 return;
126 m_client->sendArrayBuffer(presentationUrl, presentationId, data, length);
127 }
128
115 void PresentationController::closeSession(const String& url, const String& prese ntationId) 129 void PresentationController::closeSession(const String& url, const String& prese ntationId)
116 { 130 {
117 if (!m_client) 131 if (!m_client)
118 return; 132 return;
119 m_client->closeSession(url, presentationId); 133 m_client->closeSession(url, presentationId);
120 } 134 }
121 135
122 void PresentationController::setPresentation(Presentation* presentation) 136 void PresentationController::setPresentation(Presentation* presentation)
123 { 137 {
124 m_presentation = presentation; 138 m_presentation = presentation;
125 } 139 }
126 140
127 void PresentationController::willDetachFrameHost() 141 void PresentationController::willDetachFrameHost()
128 { 142 {
129 if (m_client) { 143 if (m_client) {
130 m_client->setController(nullptr); 144 m_client->setController(nullptr);
131 m_client = nullptr; 145 m_client = nullptr;
132 } 146 }
133 } 147 }
134 148
135 } // namespace blink 149 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/presentation/PresentationController.h ('k') | Source/modules/presentation/PresentationSession.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698