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

Unified Diff: Source/modules/presentation/PresentationSession.h

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: generic interface to receive binary messages. 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/presentation/PresentationSession.h
diff --git a/Source/modules/presentation/PresentationSession.h b/Source/modules/presentation/PresentationSession.h
index 410fa047d9016fb8ce3394c5eaca0d3f918fc874..c54c3cc9d4055264689fab82086144934bd869c9 100644
--- a/Source/modules/presentation/PresentationSession.h
+++ b/Source/modules/presentation/PresentationSession.h
@@ -50,6 +50,9 @@ public:
void send(Blob*, ExceptionState&);
void close();
+ String binaryType() const;
+ void setBinaryType(const String&);
+
DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange);
@@ -59,8 +62,9 @@ public:
// Notifies the session about its state change.
void didChangeState(WebPresentationSessionState);
- // Notifies the session about new text message.
+ // Notifies the session about new message.
void didReceiveTextMessage(const String& message);
+ void didReceiveBinaryMessage(const uint8_t* data, size_t length);
private:
class BlobLoader;
@@ -71,6 +75,11 @@ private:
MessageTypeBlob,
};
+ enum BinaryType {
+ BinaryTypeBlob,
+ BinaryTypeArrayBuffer
+ };
+
struct Message {
Message(const String& text)
: type(MessageTypeText)
@@ -111,6 +120,8 @@ private:
// For Blob data handling.
Member<BlobLoader> m_blobLoader;
Deque<OwnPtr<Message>> m_messages;
+
+ BinaryType m_binaryType;
USE s.singapati at gmail.com 2015/07/01 07:17:47 Need to give default value to m_binaryType in Pres
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698