| 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 #include "modules/presentation/PresentationConnection.h" | 5 #include "modules/presentation/PresentationConnection.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 8 #include "core/dom/DOMArrayBuffer.h" | 8 #include "core/dom/DOMArrayBuffer.h" |
| 9 #include "core/dom/DOMArrayBufferView.h" | 9 #include "core/dom/DOMArrayBufferView.h" |
| 10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 DEFINE_INLINE_TRACE() { visitor->trace(m_PresentationConnection); } | 143 DEFINE_INLINE_TRACE() { visitor->trace(m_PresentationConnection); } |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 Member<PresentationConnection> m_PresentationConnection; | 146 Member<PresentationConnection> m_PresentationConnection; |
| 147 std::unique_ptr<FileReaderLoader> m_loader; | 147 std::unique_ptr<FileReaderLoader> m_loader; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 PresentationConnection::PresentationConnection(LocalFrame* frame, | 150 PresentationConnection::PresentationConnection(LocalFrame* frame, |
| 151 const String& id, | 151 const String& id, |
| 152 const KURL& url) | 152 const KURL& url) |
| 153 : DOMWindowProperty(frame), | 153 : ContextClient(frame), |
| 154 m_id(id), | 154 m_id(id), |
| 155 m_url(url), | 155 m_url(url), |
| 156 m_state(WebPresentationConnectionState::Connecting), | 156 m_state(WebPresentationConnectionState::Connecting), |
| 157 m_binaryType(BinaryTypeBlob) {} | 157 m_binaryType(BinaryTypeBlob) {} |
| 158 | 158 |
| 159 PresentationConnection::~PresentationConnection() { | 159 PresentationConnection::~PresentationConnection() { |
| 160 ASSERT(!m_blobLoader); | 160 ASSERT(!m_blobLoader); |
| 161 } | 161 } |
| 162 | 162 |
| 163 // static | 163 // static |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 UseCounter::PresentationConnectionTerminateEventListener); | 244 UseCounter::PresentationConnectionTerminateEventListener); |
| 245 else if (eventType == EventTypeNames::message) | 245 else if (eventType == EventTypeNames::message) |
| 246 UseCounter::count(getExecutionContext(), | 246 UseCounter::count(getExecutionContext(), |
| 247 UseCounter::PresentationConnectionMessageEventListener); | 247 UseCounter::PresentationConnectionMessageEventListener); |
| 248 } | 248 } |
| 249 | 249 |
| 250 DEFINE_TRACE(PresentationConnection) { | 250 DEFINE_TRACE(PresentationConnection) { |
| 251 visitor->trace(m_blobLoader); | 251 visitor->trace(m_blobLoader); |
| 252 visitor->trace(m_messages); | 252 visitor->trace(m_messages); |
| 253 EventTargetWithInlineData::trace(visitor); | 253 EventTargetWithInlineData::trace(visitor); |
| 254 DOMWindowProperty::trace(visitor); | 254 ContextClient::trace(visitor); |
| 255 } | 255 } |
| 256 | 256 |
| 257 const AtomicString& PresentationConnection::state() const { | 257 const AtomicString& PresentationConnection::state() const { |
| 258 return connectionStateToString(m_state); | 258 return connectionStateToString(m_state); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void PresentationConnection::send(const String& message, | 261 void PresentationConnection::send(const String& message, |
| 262 ExceptionState& exceptionState) { | 262 ExceptionState& exceptionState) { |
| 263 if (!canSendMessage(exceptionState)) | 263 if (!canSendMessage(exceptionState)) |
| 264 return; | 264 return; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 void PresentationConnection::tearDown() { | 490 void PresentationConnection::tearDown() { |
| 491 // Cancel current Blob loading if any. | 491 // Cancel current Blob loading if any. |
| 492 if (m_blobLoader) { | 492 if (m_blobLoader) { |
| 493 m_blobLoader->cancel(); | 493 m_blobLoader->cancel(); |
| 494 m_blobLoader.clear(); | 494 m_blobLoader.clear(); |
| 495 } | 495 } |
| 496 m_messages.clear(); | 496 m_messages.clear(); |
| 497 } | 497 } |
| 498 | 498 |
| 499 } // namespace blink | 499 } // namespace blink |
| OLD | NEW |