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

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

Issue 1942723004: Change EventTarget callback APIs for add/RemoveEventListenerInternal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win32 signed/unsigned issue Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/PresentationRequest.h" 5 #include "modules/presentation/PresentationRequest.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptPromiseResolver.h" 10 #include "bindings/core/v8/ScriptPromiseResolver.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 const AtomicString& PresentationRequest::interfaceName() const 64 const AtomicString& PresentationRequest::interfaceName() const
65 { 65 {
66 return EventTargetNames::PresentationRequest; 66 return EventTargetNames::PresentationRequest;
67 } 67 }
68 68
69 ExecutionContext* PresentationRequest::getExecutionContext() const 69 ExecutionContext* PresentationRequest::getExecutionContext() const
70 { 70 {
71 return ActiveDOMObject::getExecutionContext(); 71 return ActiveDOMObject::getExecutionContext();
72 } 72 }
73 73
74 bool PresentationRequest::addEventListenerInternal(const AtomicString& eventType , EventListener* listener, const EventListenerOptions& options) 74 void PresentationRequest::addedEventListener(const AtomicString& eventType, Regi steredEventListener& registeredListener)
75 { 75 {
76 EventTargetWithInlineData::addedEventListener(eventType, registeredListener) ;
76 if (eventType == EventTypeNames::connectionavailable) 77 if (eventType == EventTypeNames::connectionavailable)
77 UseCounter::count(getExecutionContext(), UseCounter::PresentationRequest ConnectionAvailableEventListener); 78 UseCounter::count(getExecutionContext(), UseCounter::PresentationRequest ConnectionAvailableEventListener);
78
79 return EventTarget::addEventListenerInternal(eventType, listener, options);
80 } 79 }
81 80
82 bool PresentationRequest::hasPendingActivity() const 81 bool PresentationRequest::hasPendingActivity() const
83 { 82 {
84 if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStop ped()) 83 if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStop ped())
85 return false; 84 return false;
86 85
87 // Prevents garbage collecting of this object when not hold by another 86 // Prevents garbage collecting of this object when not hold by another
88 // object but still has listeners registered. 87 // object but still has listeners registered.
89 return hasEventListeners(); 88 return hasEventListeners();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 152 }
154 153
155 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, con st KURL& url) 154 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, con st KURL& url)
156 : ActiveScriptWrappable(this) 155 : ActiveScriptWrappable(this)
157 , ActiveDOMObject(executionContext) 156 , ActiveDOMObject(executionContext)
158 , m_url(url) 157 , m_url(url)
159 { 158 {
160 } 159 }
161 160
162 } // namespace blink 161 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698