| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 return EventTargetNames::PresentationConnection; | 155 return EventTargetNames::PresentationConnection; |
| 156 } | 156 } |
| 157 | 157 |
| 158 ExecutionContext* PresentationConnection::executionContext() const | 158 ExecutionContext* PresentationConnection::executionContext() const |
| 159 { | 159 { |
| 160 if (!frame()) | 160 if (!frame()) |
| 161 return nullptr; | 161 return nullptr; |
| 162 return frame()->document(); | 162 return frame()->document(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 bool PresentationConnection::addEventListenerInternal(const AtomicString& eventT
ype, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions&
options) | 165 bool PresentationConnection::addEventListenerInternal(const AtomicString& eventT
ype, RawPtr<EventListener> listener, const EventListenerOptions& options) |
| 166 { | 166 { |
| 167 if (eventType == EventTypeNames::statechange) | 167 if (eventType == EventTypeNames::statechange) |
| 168 UseCounter::count(executionContext(), UseCounter::PresentationConnection
StateChangeEventListener); | 168 UseCounter::count(executionContext(), UseCounter::PresentationConnection
StateChangeEventListener); |
| 169 else if (eventType == EventTypeNames::message) | 169 else if (eventType == EventTypeNames::message) |
| 170 UseCounter::count(executionContext(), UseCounter::PresentationConnection
MessageEventListener); | 170 UseCounter::count(executionContext(), UseCounter::PresentationConnection
MessageEventListener); |
| 171 | 171 |
| 172 return EventTarget::addEventListenerInternal(eventType, listener, options); | 172 return EventTarget::addEventListenerInternal(eventType, listener, options); |
| 173 } | 173 } |
| 174 | 174 |
| 175 DEFINE_TRACE(PresentationConnection) | 175 DEFINE_TRACE(PresentationConnection) |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 m_blobLoader->cancel(); | 380 m_blobLoader->cancel(); |
| 381 m_blobLoader.clear(); | 381 m_blobLoader.clear(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 // Clear message queue. | 384 // Clear message queue. |
| 385 Deque<OwnPtr<Message>> empty; | 385 Deque<OwnPtr<Message>> empty; |
| 386 m_messages.swap(empty); | 386 m_messages.swap(empty); |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace blink | 389 } // namespace blink |
| OLD | NEW |