| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BroadcastChannel_h | 5 #ifndef BroadcastChannel_h |
| 6 #define BroadcastChannel_h | 6 #define BroadcastChannel_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 9 #include "core/dom/ContextLifecycleObserver.h" | 9 #include "core/dom/ContextLifecycleObserver.h" |
| 10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // IDL | 31 // IDL |
| 32 String name() const { return m_name; } | 32 String name() const { return m_name; } |
| 33 void postMessage(const ScriptValue&, ExceptionState&); | 33 void postMessage(const ScriptValue&, ExceptionState&); |
| 34 void close(); | 34 void close(); |
| 35 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 35 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 36 | 36 |
| 37 // EventTarget: | 37 // EventTarget: |
| 38 const AtomicString& interfaceName() const override; | 38 const AtomicString& interfaceName() const override; |
| 39 ExecutionContext* getExecutionContext() const override { return ContextLifec
ycleObserver::getExecutionContext(); } | 39 ExecutionContext* getExecutionContext() const override { return ContextLifec
ycleObserver::getExecutionContext(); } |
| 40 | 40 |
| 41 // ActiveScriptWrappable: | 41 // ScriptWrappable: |
| 42 bool hasPendingActivity() const override; | 42 bool hasPendingActivity() const override; |
| 43 | 43 |
| 44 // ContextLifecycleObserver: | 44 // ContextLifecycleObserver: |
| 45 void contextDestroyed() override; | 45 void contextDestroyed() override; |
| 46 | 46 |
| 47 DECLARE_VIRTUAL_TRACE(); | 47 DECLARE_VIRTUAL_TRACE(); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 BroadcastChannel(ExecutionContext*, const String& name); | 50 BroadcastChannel(ExecutionContext*, const String& name); |
| 51 | 51 |
| 52 // mojom::blink::BroadcastChannelClient: | 52 // mojom::blink::BroadcastChannelClient: |
| 53 void OnMessage(mojo::WTFArray<uint8_t> message) override; | 53 void OnMessage(mojo::WTFArray<uint8_t> message) override; |
| 54 | 54 |
| 55 // Called when the mojo binding disconnects. | 55 // Called when the mojo binding disconnects. |
| 56 void onError(); | 56 void onError(); |
| 57 | 57 |
| 58 RefPtr<SecurityOrigin> m_origin; | 58 RefPtr<SecurityOrigin> m_origin; |
| 59 String m_name; | 59 String m_name; |
| 60 | 60 |
| 61 mojo::AssociatedBinding<mojom::blink::BroadcastChannelClient> m_binding; | 61 mojo::AssociatedBinding<mojom::blink::BroadcastChannelClient> m_binding; |
| 62 mojom::blink::BroadcastChannelClientAssociatedPtr m_remoteClient; | 62 mojom::blink::BroadcastChannelClientAssociatedPtr m_remoteClient; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace blink | 65 } // namespace blink |
| 66 | 66 |
| 67 #endif // BroadcastChannel_h | 67 #endif // BroadcastChannel_h |
| OLD | NEW |