Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp

Issue 1922093003: Add AddEventListenerOptions addEventListenerOptions interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 bool PresentationConnection::addEventListenerInternal(const AtomicString& eventT ype, EventListener* listener, const AddEventListenerOptions& options)
218 { 218 {
219 if (eventType == EventTypeNames::connect) 219 if (eventType == EventTypeNames::connect)
220 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect ionConnectEventListener); 220 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect ionConnectEventListener);
221 else if (eventType == EventTypeNames::close) 221 else if (eventType == EventTypeNames::close)
222 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect ionCloseEventListener); 222 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect ionCloseEventListener);
223 else if (eventType == EventTypeNames::terminate) 223 else if (eventType == EventTypeNames::terminate)
224 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect ionTerminateEventListener); 224 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect ionTerminateEventListener);
225 else if (eventType == EventTypeNames::message) 225 else if (eventType == EventTypeNames::message)
226 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect ionMessageEventListener); 226 UseCounter::count(getExecutionContext(), UseCounter::PresentationConnect ionMessageEventListener);
227 227
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 { 454 {
455 // Cancel current Blob loading if any. 455 // Cancel current Blob loading if any.
456 if (m_blobLoader) { 456 if (m_blobLoader) {
457 m_blobLoader->cancel(); 457 m_blobLoader->cancel();
458 m_blobLoader.clear(); 458 m_blobLoader.clear();
459 } 459 }
460 m_messages.clear(); 460 m_messages.clear();
461 } 461 }
462 462
463 } // namespace blink 463 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698