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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 DCHECK(success); | 118 DCHECK(success); |
119 ALLOW_UNUSED_LOCAL(success); | 119 ALLOW_UNUSED_LOCAL(success); |
120 } | 120 } |
121 | 121 |
122 void BroadcastChannel::onError() { | 122 void BroadcastChannel::onError() { |
123 close(); | 123 close(); |
124 } | 124 } |
125 | 125 |
126 BroadcastChannel::BroadcastChannel(ExecutionContext* executionContext, | 126 BroadcastChannel::BroadcastChannel(ExecutionContext* executionContext, |
127 const String& name) | 127 const String& name) |
128 : ActiveScriptWrappable(this), | 128 : ActiveScriptWrappable<BroadcastChannel>(this), |
129 ContextLifecycleObserver(executionContext), | 129 ContextLifecycleObserver(executionContext), |
130 m_origin(executionContext->getSecurityOrigin()), | 130 m_origin(executionContext->getSecurityOrigin()), |
131 m_name(name), | 131 m_name(name), |
132 m_binding(this) { | 132 m_binding(this) { |
133 mojom::blink::BroadcastChannelProviderPtr& provider = | 133 mojom::blink::BroadcastChannelProviderPtr& provider = |
134 getThreadSpecificProvider(); | 134 getThreadSpecificProvider(); |
135 | 135 |
136 // Local BroadcastChannelClient for messages send from the browser to this | 136 // Local BroadcastChannelClient for messages send from the browser to this |
137 // channel. | 137 // channel. |
138 mojom::blink::BroadcastChannelClientAssociatedPtrInfo localClientInfo; | 138 mojom::blink::BroadcastChannelClientAssociatedPtrInfo localClientInfo; |
(...skipping 11 matching lines...) Expand all Loading... |
150 &remoteCientRequest); | 150 &remoteCientRequest); |
151 m_remoteClient.Bind(std::move(remoteClientInfo)); | 151 m_remoteClient.Bind(std::move(remoteClientInfo)); |
152 m_remoteClient.set_connection_error_handler(convertToBaseCallback( | 152 m_remoteClient.set_connection_error_handler(convertToBaseCallback( |
153 WTF::bind(&BroadcastChannel::onError, wrapWeakPersistent(this)))); | 153 WTF::bind(&BroadcastChannel::onError, wrapWeakPersistent(this)))); |
154 | 154 |
155 provider->ConnectToChannel(m_origin, m_name, std::move(localClientInfo), | 155 provider->ConnectToChannel(m_origin, m_name, std::move(localClientInfo), |
156 std::move(remoteCientRequest)); | 156 std::move(remoteCientRequest)); |
157 } | 157 } |
158 | 158 |
159 } // namespace blink | 159 } // namespace blink |
OLD | NEW |