| 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 #include "modules/broadcastchannel/BroadcastChannel.h" | 5 #include "modules/broadcastchannel/BroadcastChannel.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/SerializedScriptValue.h" | 7 #include "bindings/core/v8/SerializedScriptValue.h" |
| 8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
| 9 #include "core/events/EventQueue.h" | 9 #include "core/events/EventQueue.h" |
| 10 #include "core/events/MessageEvent.h" | 10 #include "core/events/MessageEvent.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 | 89 |
| 90 const AtomicString& BroadcastChannel::interfaceName() const { | 90 const AtomicString& BroadcastChannel::interfaceName() const { |
| 91 return EventTargetNames::BroadcastChannel; | 91 return EventTargetNames::BroadcastChannel; |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool BroadcastChannel::hasPendingActivity() const { | 94 bool BroadcastChannel::hasPendingActivity() const { |
| 95 return m_binding.is_bound() && hasEventListeners(EventTypeNames::message); | 95 return m_binding.is_bound() && hasEventListeners(EventTypeNames::message); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void BroadcastChannel::contextDestroyed() { | 98 void BroadcastChannel::contextDestroyed(ExecutionContext*) { |
| 99 close(); | 99 close(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 DEFINE_TRACE(BroadcastChannel) { | 102 DEFINE_TRACE(BroadcastChannel) { |
| 103 ContextLifecycleObserver::trace(visitor); | 103 ContextLifecycleObserver::trace(visitor); |
| 104 EventTargetWithInlineData::trace(visitor); | 104 EventTargetWithInlineData::trace(visitor); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void BroadcastChannel::OnMessage(const WTF::Vector<uint8_t>& message) { | 107 void BroadcastChannel::OnMessage(const WTF::Vector<uint8_t>& message) { |
| 108 // Queue a task to dispatch the event. | 108 // Queue a task to dispatch the event. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 &remoteCientRequest); | 149 &remoteCientRequest); |
| 150 m_remoteClient.Bind(std::move(remoteClientInfo)); | 150 m_remoteClient.Bind(std::move(remoteClientInfo)); |
| 151 m_remoteClient.set_connection_error_handler(convertToBaseCallback( | 151 m_remoteClient.set_connection_error_handler(convertToBaseCallback( |
| 152 WTF::bind(&BroadcastChannel::onError, wrapWeakPersistent(this)))); | 152 WTF::bind(&BroadcastChannel::onError, wrapWeakPersistent(this)))); |
| 153 | 153 |
| 154 provider->ConnectToChannel(m_origin, m_name, std::move(localClientInfo), | 154 provider->ConnectToChannel(m_origin, m_name, std::move(localClientInfo), |
| 155 std::move(remoteCientRequest)); | 155 std::move(remoteCientRequest)); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace blink | 158 } // namespace blink |
| OLD | NEW |