| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 return EventTargetNames::PresentationConnection; | 207 return EventTargetNames::PresentationConnection; |
| 208 } | 208 } |
| 209 | 209 |
| 210 ExecutionContext* PresentationConnection::getExecutionContext() const | 210 ExecutionContext* PresentationConnection::getExecutionContext() const |
| 211 { | 211 { |
| 212 if (!frame()) | 212 if (!frame()) |
| 213 return nullptr; | 213 return nullptr; |
| 214 return frame()->document(); | 214 return frame()->document(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 bool PresentationConnection::addEventListenerInternal(const AtomicString& eventT
ype, EventListener* listener, const EventListenerOptions& options) | 217 void PresentationConnection::addedEventListener(const AtomicString& eventType, R
egisteredEventListener& registeredListener) |
| 218 { | 218 { |
| 219 EventTargetWithInlineData::addedEventListener(eventType, registeredListener)
; |
| 219 if (eventType == EventTypeNames::connect) | 220 if (eventType == EventTypeNames::connect) |
| 220 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect
ionConnectEventListener); | 221 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect
ionConnectEventListener); |
| 221 else if (eventType == EventTypeNames::close) | 222 else if (eventType == EventTypeNames::close) |
| 222 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect
ionCloseEventListener); | 223 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect
ionCloseEventListener); |
| 223 else if (eventType == EventTypeNames::terminate) | 224 else if (eventType == EventTypeNames::terminate) |
| 224 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect
ionTerminateEventListener); | 225 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect
ionTerminateEventListener); |
| 225 else if (eventType == EventTypeNames::message) | 226 else if (eventType == EventTypeNames::message) |
| 226 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect
ionMessageEventListener); | 227 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect
ionMessageEventListener); |
| 227 | |
| 228 return EventTarget::addEventListenerInternal(eventType, listener, options); | |
| 229 } | 228 } |
| 230 | 229 |
| 231 DEFINE_TRACE(PresentationConnection) | 230 DEFINE_TRACE(PresentationConnection) |
| 232 { | 231 { |
| 233 visitor->trace(m_blobLoader); | 232 visitor->trace(m_blobLoader); |
| 234 visitor->trace(m_messages); | 233 visitor->trace(m_messages); |
| 235 EventTargetWithInlineData::trace(visitor); | 234 EventTargetWithInlineData::trace(visitor); |
| 236 DOMWindowProperty::trace(visitor); | 235 DOMWindowProperty::trace(visitor); |
| 237 } | 236 } |
| 238 | 237 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 { | 453 { |
| 455 // Cancel current Blob loading if any. | 454 // Cancel current Blob loading if any. |
| 456 if (m_blobLoader) { | 455 if (m_blobLoader) { |
| 457 m_blobLoader->cancel(); | 456 m_blobLoader->cancel(); |
| 458 m_blobLoader.clear(); | 457 m_blobLoader.clear(); |
| 459 } | 458 } |
| 460 m_messages.clear(); | 459 m_messages.clear(); |
| 461 } | 460 } |
| 462 | 461 |
| 463 } // namespace blink | 462 } // namespace blink |
| OLD | NEW |