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

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

Issue 2607533002: Prefer using ContextClient over ContextLifecycleObserver (Closed)
Patch Set: Created 3 years, 11 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 return new PresentationRequest(executionContext, parsedUrl); 79 return new PresentationRequest(executionContext, parsedUrl);
80 } 80 }
81 81
82 const AtomicString& PresentationRequest::interfaceName() const { 82 const AtomicString& PresentationRequest::interfaceName() const {
83 return EventTargetNames::PresentationRequest; 83 return EventTargetNames::PresentationRequest;
84 } 84 }
85 85
86 ExecutionContext* PresentationRequest::getExecutionContext() const { 86 ExecutionContext* PresentationRequest::getExecutionContext() const {
87 return ContextLifecycleObserver::getExecutionContext(); 87 return ContextClient::getExecutionContext();
88 } 88 }
89 89
90 void PresentationRequest::addedEventListener( 90 void PresentationRequest::addedEventListener(
91 const AtomicString& eventType, 91 const AtomicString& eventType,
92 RegisteredEventListener& registeredListener) { 92 RegisteredEventListener& registeredListener) {
93 EventTargetWithInlineData::addedEventListener(eventType, registeredListener); 93 EventTargetWithInlineData::addedEventListener(eventType, registeredListener);
94 if (eventType == EventTypeNames::connectionavailable) 94 if (eventType == EventTypeNames::connectionavailable)
95 UseCounter::count( 95 UseCounter::count(
96 getExecutionContext(), 96 getExecutionContext(),
97 UseCounter::PresentationRequestConnectionAvailableEventListener); 97 UseCounter::PresentationRequestConnectionAvailableEventListener);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 return m_availabilityProperty->promise(scriptState->world()); 198 return m_availabilityProperty->promise(scriptState->world());
199 } 199 }
200 200
201 const KURL& PresentationRequest::url() const { 201 const KURL& PresentationRequest::url() const {
202 return m_url; 202 return m_url;
203 } 203 }
204 204
205 DEFINE_TRACE(PresentationRequest) { 205 DEFINE_TRACE(PresentationRequest) {
206 visitor->trace(m_availabilityProperty); 206 visitor->trace(m_availabilityProperty);
207 EventTargetWithInlineData::trace(visitor); 207 EventTargetWithInlineData::trace(visitor);
208 ContextLifecycleObserver::trace(visitor); 208 ContextClient::trace(visitor);
209 } 209 }
210 210
211 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, 211 PresentationRequest::PresentationRequest(ExecutionContext* executionContext,
212 const KURL& url) 212 const KURL& url)
213 : ContextLifecycleObserver(executionContext), m_url(url) {} 213 : ContextClient(executionContext), m_url(url) {}
214 214
215 } // namespace blink 215 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698