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 PresentationConnection_h | 5 #ifndef PresentationConnection_h |
6 #define PresentationConnection_h | 6 #define PresentationConnection_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" |
11 #include "core/frame/DOMWindowProperty.h" | 11 #include "core/frame/DOMWindowProperty.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 13 #include "platform/weborigin/KURL.h" |
13 #include "public/platform/modules/presentation/WebPresentationConnectionClient.h
" | 14 #include "public/platform/modules/presentation/WebPresentationConnectionClient.h
" |
14 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
15 #include <memory> | 16 #include <memory> |
16 | 17 |
17 namespace WTF { | 18 namespace WTF { |
18 class AtomicString; | 19 class AtomicString; |
19 } // namespace WTF | 20 } // namespace WTF |
20 | 21 |
21 namespace blink { | 22 namespace blink { |
22 | 23 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 MessageTypeBlob, | 91 MessageTypeBlob, |
91 }; | 92 }; |
92 | 93 |
93 enum BinaryType { | 94 enum BinaryType { |
94 BinaryTypeBlob, | 95 BinaryTypeBlob, |
95 BinaryTypeArrayBuffer | 96 BinaryTypeArrayBuffer |
96 }; | 97 }; |
97 | 98 |
98 class Message; | 99 class Message; |
99 | 100 |
100 PresentationConnection(LocalFrame*, const String& id, const String& url); | 101 PresentationConnection(LocalFrame*, const String& id, const KURL&); |
101 | 102 |
102 bool canSendMessage(ExceptionState&); | 103 bool canSendMessage(ExceptionState&); |
103 void handleMessageQueue(); | 104 void handleMessageQueue(); |
104 | 105 |
105 // Callbacks invoked from BlobLoader. | 106 // Callbacks invoked from BlobLoader. |
106 void didFinishLoadingBlob(DOMArrayBuffer*); | 107 void didFinishLoadingBlob(DOMArrayBuffer*); |
107 void didFailLoadingBlob(FileError::ErrorCode); | 108 void didFailLoadingBlob(FileError::ErrorCode); |
108 | 109 |
109 // Cancel loads and pending messages when the connection is closed. | 110 // Cancel loads and pending messages when the connection is closed. |
110 void tearDown(); | 111 void tearDown(); |
111 | 112 |
112 String m_id; | 113 String m_id; |
113 String m_url; | 114 KURL m_url; |
114 WebPresentationConnectionState m_state; | 115 WebPresentationConnectionState m_state; |
115 | 116 |
116 // For Blob data handling. | 117 // For Blob data handling. |
117 Member<BlobLoader> m_blobLoader; | 118 Member<BlobLoader> m_blobLoader; |
118 HeapDeque<Member<Message>> m_messages; | 119 HeapDeque<Member<Message>> m_messages; |
119 | 120 |
120 BinaryType m_binaryType; | 121 BinaryType m_binaryType; |
121 }; | 122 }; |
122 | 123 |
123 } // namespace blink | 124 } // namespace blink |
124 | 125 |
125 #endif // PresentationConnection_h | 126 #endif // PresentationConnection_h |
OLD | NEW |