OLD | NEW |
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 parsedUrls[i] = parsedUrl; | 102 parsedUrls[i] = parsedUrl; |
103 } | 103 } |
104 return new PresentationRequest(executionContext, parsedUrls); | 104 return new PresentationRequest(executionContext, parsedUrls); |
105 } | 105 } |
106 | 106 |
107 const AtomicString& PresentationRequest::interfaceName() const { | 107 const AtomicString& PresentationRequest::interfaceName() const { |
108 return EventTargetNames::PresentationRequest; | 108 return EventTargetNames::PresentationRequest; |
109 } | 109 } |
110 | 110 |
111 ExecutionContext* PresentationRequest::getExecutionContext() const { | 111 ExecutionContext* PresentationRequest::getExecutionContext() const { |
112 return ContextLifecycleObserver::getExecutionContext(); | 112 return ContextClient::getExecutionContext(); |
113 } | 113 } |
114 | 114 |
115 void PresentationRequest::addedEventListener( | 115 void PresentationRequest::addedEventListener( |
116 const AtomicString& eventType, | 116 const AtomicString& eventType, |
117 RegisteredEventListener& registeredListener) { | 117 RegisteredEventListener& registeredListener) { |
118 EventTargetWithInlineData::addedEventListener(eventType, registeredListener); | 118 EventTargetWithInlineData::addedEventListener(eventType, registeredListener); |
119 if (eventType == EventTypeNames::connectionavailable) | 119 if (eventType == EventTypeNames::connectionavailable) |
120 UseCounter::count( | 120 UseCounter::count( |
121 getExecutionContext(), | 121 getExecutionContext(), |
122 UseCounter::PresentationRequestConnectionAvailableEventListener); | 122 UseCounter::PresentationRequestConnectionAvailableEventListener); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 return m_availabilityProperty->promise(scriptState->world()); | 214 return m_availabilityProperty->promise(scriptState->world()); |
215 } | 215 } |
216 | 216 |
217 const Vector<KURL>& PresentationRequest::urls() const { | 217 const Vector<KURL>& PresentationRequest::urls() const { |
218 return m_urls; | 218 return m_urls; |
219 } | 219 } |
220 | 220 |
221 DEFINE_TRACE(PresentationRequest) { | 221 DEFINE_TRACE(PresentationRequest) { |
222 visitor->trace(m_availabilityProperty); | 222 visitor->trace(m_availabilityProperty); |
223 EventTargetWithInlineData::trace(visitor); | 223 EventTargetWithInlineData::trace(visitor); |
224 ContextLifecycleObserver::trace(visitor); | 224 ContextClient::trace(visitor); |
225 } | 225 } |
226 | 226 |
227 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, | 227 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, |
228 const Vector<KURL>& urls) | 228 const Vector<KURL>& urls) |
229 : ContextLifecycleObserver(executionContext), m_urls(urls) { | 229 : ContextClient(executionContext), m_urls(urls) { |
230 recordOriginTypeAccess(executionContext); | 230 recordOriginTypeAccess(executionContext); |
231 } | 231 } |
232 | 232 |
233 void PresentationRequest::recordOriginTypeAccess( | 233 void PresentationRequest::recordOriginTypeAccess( |
234 ExecutionContext* executionContext) const { | 234 ExecutionContext* executionContext) const { |
235 DCHECK(executionContext); | 235 DCHECK(executionContext); |
236 if (executionContext->isSecureContext()) { | 236 if (executionContext->isSecureContext()) { |
237 UseCounter::count(executionContext, | 237 UseCounter::count(executionContext, |
238 UseCounter::PresentationRequestSecureOrigin); | 238 UseCounter::PresentationRequestSecureOrigin); |
239 } else { | 239 } else { |
240 UseCounter::count(executionContext, | 240 UseCounter::count(executionContext, |
241 UseCounter::PresentationRequestInsecureOrigin); | 241 UseCounter::PresentationRequestInsecureOrigin); |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 } // namespace blink | 245 } // namespace blink |
OLD | NEW |