| 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/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
| 9 #include "core/events/EventTarget.h" | 9 #include "core/events/EventTarget.h" |
| 10 #include "core/fileapi/Blob.h" | 10 #include "core/fileapi/Blob.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(terminate); | 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(terminate); |
| 75 | 75 |
| 76 // Returns true if and only if the the session info represents this | 76 // Returns true if and only if the the session info represents this |
| 77 // connection. | 77 // connection. |
| 78 bool matches(const WebPresentationSessionInfo&) const; | 78 bool matches(const WebPresentationSessionInfo&) const; |
| 79 | 79 |
| 80 // Returns true if this connection's id equals to |id| and its url equals to | 80 // Returns true if this connection's id equals to |id| and its url equals to |
| 81 // |url|. | 81 // |url|. |
| 82 bool matches(const String& id, const KURL&) const; | 82 bool matches(const String& id, const KURL&) const; |
| 83 | 83 |
| 84 // Notifies the connection about its state change to 'closed'. | |
| 85 void didClose(WebPresentationConnectionCloseReason, const String& message); | |
| 86 | |
| 87 // WebPresentationConnection implementation. | 84 // WebPresentationConnection implementation. |
| 88 void bindProxy(std::unique_ptr<WebPresentationConnectionProxy>) override; | 85 void bindProxy(std::unique_ptr<WebPresentationConnectionProxy>) override; |
| 89 void didReceiveTextMessage(const WebString& message) override; | 86 void didReceiveTextMessage(const WebString& message) override; |
| 90 void didReceiveBinaryMessage(const uint8_t* data, size_t length) override; | 87 void didReceiveBinaryMessage(const uint8_t* data, size_t length) override; |
| 91 void didChangeState(WebPresentationConnectionState) override; | 88 void didChangeState(WebPresentationConnectionState) override; |
| 89 void didClose(WebPresentationConnectionCloseReason, |
| 90 const WebString& message) override; |
| 92 | 91 |
| 93 WebPresentationConnectionState getState(); | 92 WebPresentationConnectionState getState(); |
| 94 void didChangeState(WebPresentationConnectionState, bool shouldDispatchEvent); | 93 void didChangeState(WebPresentationConnectionState, bool shouldDispatchEvent); |
| 95 | 94 |
| 96 protected: | 95 protected: |
| 97 // EventTarget implementation. | 96 // EventTarget implementation. |
| 98 void addedEventListener(const AtomicString& eventType, | 97 void addedEventListener(const AtomicString& eventType, |
| 99 RegisteredEventListener&) override; | 98 RegisteredEventListener&) override; |
| 100 | 99 |
| 101 private: | 100 private: |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 HeapDeque<Member<Message>> m_messages; | 135 HeapDeque<Member<Message>> m_messages; |
| 137 | 136 |
| 138 BinaryType m_binaryType; | 137 BinaryType m_binaryType; |
| 139 | 138 |
| 140 std::unique_ptr<WebPresentationConnectionProxy> m_proxy; | 139 std::unique_ptr<WebPresentationConnectionProxy> m_proxy; |
| 141 }; | 140 }; |
| 142 | 141 |
| 143 } // namespace blink | 142 } // namespace blink |
| 144 | 143 |
| 145 #endif // PresentationConnection_h | 144 #endif // PresentationConnection_h |
| OLD | NEW |