Index: Source/modules/presentation/PresentationSession.h |
diff --git a/Source/modules/presentation/PresentationSession.h b/Source/modules/presentation/PresentationSession.h |
index 378995d434d77e45b804057c0fda35fbafcf9afd..2fef40a6b32c5663c72c04ba621c38f7889a67c8 100644 |
--- a/Source/modules/presentation/PresentationSession.h |
+++ b/Source/modules/presentation/PresentationSession.h |
@@ -6,6 +6,8 @@ |
#define PresentationSession_h |
#include "core/events/EventTarget.h" |
+#include "core/fileapi/Blob.h" |
+#include "core/fileapi/FileError.h" |
#include "core/frame/DOMWindowProperty.h" |
#include "public/platform/modules/presentation/WebPresentationSessionClient.h" |
#include "wtf/text/WTFString.h" |
@@ -44,6 +46,7 @@ public: |
void send(const String& message, ExceptionState&); |
void send(PassRefPtr<DOMArrayBuffer> data, ExceptionState&); |
void send(PassRefPtr<DOMArrayBufferView> data, ExceptionState&); |
+ void send(Blob* data, ExceptionState&); |
void close(); |
DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
@@ -59,6 +62,17 @@ public: |
void didReceiveTextMessage(const String& message); |
private: |
+ // Blob data items are queued and sent after loading asynchronously. |
+ struct Message { |
+ Message(PassRefPtr<BlobDataHandle> blobDataHandle) |
+ : blobDataHandle(blobDataHandle) |
+ { |
+ } |
+ |
+ RefPtr<BlobDataHandle> blobDataHandle; |
+ // TODO(): Check the need for queuing String and ArrayBuffer also. |
mlamouri (slow - plz ping)
2015/05/19 13:08:55
TODO(<handle>), plz
mark a. foltz
2015/05/20 15:40:04
What does this mean? String and ArrayBuffer shoul
USE s.singapati at gmail.com
2015/05/21 19:49:55
Updated comments. Currently String and ArrayBuffer
|
+ }; |
+ |
PresentationSession(LocalFrame*, const String& id, const String& url); |
// Returns the |PresentationController| object associated with the frame |
@@ -69,9 +83,20 @@ private: |
// Common send method for both ArrayBufferView and ArrayBuffer. |
void sendInternal(const uint8_t* data, size_t, ExceptionState&); |
+ void handleMessageQueue(); |
+ |
+ class BlobLoader; |
mark a. foltz
2015/05/20 15:40:04
Forward declarations should go immediately after p
mark a. foltz
2015/05/20 15:40:04
Should this be class BlobLoader {
void didFinish
USE s.singapati at gmail.com
2015/05/21 19:49:54
Done. Updated comment. didFinishLoadingBlob() & di
USE s.singapati at gmail.com
2015/05/21 19:49:55
Done.
|
+ // Methods for BlobLoader. |
mlamouri (slow - plz ping)
2015/05/19 13:08:55
s/Methods/Callbacks/
USE s.singapati at gmail.com
2015/05/21 19:49:55
Done.
|
+ void didFinishLoadingBlob(PassRefPtr<DOMArrayBuffer>); |
+ void didFailLoadingBlob(FileError::ErrorCode); |
+ |
String m_id; |
String m_url; |
WebPresentationSessionState m_state; |
+ |
+ // For Blob data handling. |
+ Member<BlobLoader> m_blobLoader; |
+ Deque<OwnPtr<Message>> m_messages; |
}; |
} // namespace blink |