| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 class DOMArrayBuffer; | 23 class DOMArrayBuffer; |
| 24 class DOMArrayBufferView; | 24 class DOMArrayBufferView; |
| 25 class PresentationController; | 25 class PresentationController; |
| 26 class PresentationRequest; | 26 class PresentationRequest; |
| 27 | 27 |
| 28 class PresentationConnection final | 28 class PresentationConnection final |
| 29 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationCon
nection> | 29 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationCon
nection> |
| 30 , public DOMWindowProperty { | 30 , public DOMWindowProperty { |
| 31 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationConnection); | 31 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationConnection); |
| 32 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationConnection); | 32 USING_GARBAGE_COLLECTED_MIXIN(PresentationConnection); |
| 33 DEFINE_WRAPPERTYPEINFO(); | 33 DEFINE_WRAPPERTYPEINFO(); |
| 34 public: | 34 public: |
| 35 // For CallbackPromiseAdapter. | 35 // For CallbackPromiseAdapter. |
| 36 using WebType = OwnPtr<WebPresentationConnectionClient>; | 36 using WebType = OwnPtr<WebPresentationConnectionClient>; |
| 37 | 37 |
| 38 static PresentationConnection* take(ScriptPromiseResolver*, PassOwnPtr<WebPr
esentationConnectionClient>, PresentationRequest*); | 38 static PresentationConnection* take(ScriptPromiseResolver*, PassOwnPtr<WebPr
esentationConnectionClient>, PresentationRequest*); |
| 39 static PresentationConnection* take(PresentationController*, PassOwnPtr<WebP
resentationConnectionClient>, PresentationRequest*); | 39 static PresentationConnection* take(PresentationController*, PassOwnPtr<WebP
resentationConnectionClient>, PresentationRequest*); |
| 40 ~PresentationConnection() override; | 40 ~PresentationConnection() override; |
| 41 | 41 |
| 42 // EventTarget implementation. | 42 // EventTarget implementation. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 72 | 72 |
| 73 // Notifies the connection about its state change to 'closed'. | 73 // Notifies the connection about its state change to 'closed'. |
| 74 void didClose(WebPresentationConnectionCloseReason, const String& message); | 74 void didClose(WebPresentationConnectionCloseReason, const String& message); |
| 75 | 75 |
| 76 // Notifies the presentation about new message. | 76 // Notifies the presentation about new message. |
| 77 void didReceiveTextMessage(const String& message); | 77 void didReceiveTextMessage(const String& message); |
| 78 void didReceiveBinaryMessage(const uint8_t* data, size_t length); | 78 void didReceiveBinaryMessage(const uint8_t* data, size_t length); |
| 79 | 79 |
| 80 protected: | 80 protected: |
| 81 // EventTarget implementation. | 81 // EventTarget implementation. |
| 82 bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillB
eRawPtr<EventListener>, const EventListenerOptions&) override; | 82 bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventLis
tener>, const EventListenerOptions&) override; |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 class BlobLoader; | 85 class BlobLoader; |
| 86 | 86 |
| 87 enum MessageType { | 87 enum MessageType { |
| 88 MessageTypeText, | 88 MessageTypeText, |
| 89 MessageTypeArrayBuffer, | 89 MessageTypeArrayBuffer, |
| 90 MessageTypeBlob, | 90 MessageTypeBlob, |
| 91 }; | 91 }; |
| 92 | 92 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // For Blob data handling. | 133 // For Blob data handling. |
| 134 Member<BlobLoader> m_blobLoader; | 134 Member<BlobLoader> m_blobLoader; |
| 135 Deque<OwnPtr<Message>> m_messages; | 135 Deque<OwnPtr<Message>> m_messages; |
| 136 | 136 |
| 137 BinaryType m_binaryType; | 137 BinaryType m_binaryType; |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 } // namespace blink | 140 } // namespace blink |
| 141 | 141 |
| 142 #endif // PresentationConnection_h | 142 #endif // PresentationConnection_h |
| OLD | NEW |