OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef PresentationSession_h | 5 #ifndef PresentationSession_h |
6 #define PresentationSession_h | 6 #define PresentationSession_h |
7 | 7 |
8 #include "core/events/EventTarget.h" | 8 #include "core/events/EventTarget.h" |
9 #include "core/fileapi/Blob.h" | 9 #include "core/fileapi/Blob.h" |
10 #include "core/fileapi/FileError.h" | 10 #include "core/fileapi/FileError.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 53 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
54 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 54 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
55 | 55 |
56 // Returns true if and only if the WebPresentationSessionClient represents t
his session. | 56 // Returns true if and only if the WebPresentationSessionClient represents t
his session. |
57 bool matches(WebPresentationSessionClient*) const; | 57 bool matches(WebPresentationSessionClient*) const; |
58 | 58 |
59 // Notifies the session about its state change. | 59 // Notifies the session about its state change. |
60 void didChangeState(WebPresentationSessionState); | 60 void didChangeState(WebPresentationSessionState); |
61 | 61 |
62 // Notifies the session about new text message. | 62 // Notifies the session about new message. |
63 void didReceiveTextMessage(const String& message); | 63 void didReceiveTextMessage(const String& message); |
| 64 void didReceiveArrayBufferMessage(const uint8_t* data, size_t length); |
| 65 void didReceiveBlobMessage(const uint8_t* data, size_t length); |
64 | 66 |
65 private: | 67 private: |
66 class BlobLoader; | 68 class BlobLoader; |
67 | 69 |
68 enum MessageType { | 70 enum MessageType { |
69 MessageTypeText, | 71 MessageTypeText, |
70 MessageTypeArrayBuffer, | 72 MessageTypeArrayBuffer, |
71 MessageTypeBlob, | 73 MessageTypeBlob, |
72 }; | 74 }; |
73 | 75 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 WebPresentationSessionState m_state; | 111 WebPresentationSessionState m_state; |
110 | 112 |
111 // For Blob data handling. | 113 // For Blob data handling. |
112 Member<BlobLoader> m_blobLoader; | 114 Member<BlobLoader> m_blobLoader; |
113 Deque<OwnPtr<Message>> m_messages; | 115 Deque<OwnPtr<Message>> m_messages; |
114 }; | 116 }; |
115 | 117 |
116 } // namespace blink | 118 } // namespace blink |
117 | 119 |
118 #endif // PresentationSession_h | 120 #endif // PresentationSession_h |
OLD | NEW |