| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/imagecapture/ImageCapture.h" | 5 #include "modules/imagecapture/ImageCapture.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
| 10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 ExecutionContext* ImageCapture::getExecutionContext() const { | 85 ExecutionContext* ImageCapture::getExecutionContext() const { |
| 86 return ContextLifecycleObserver::getExecutionContext(); | 86 return ContextLifecycleObserver::getExecutionContext(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 bool ImageCapture::hasPendingActivity() const { | 89 bool ImageCapture::hasPendingActivity() const { |
| 90 return getExecutionContext() && hasEventListeners(); | 90 return getExecutionContext() && hasEventListeners(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void ImageCapture::contextDestroyed() { | 93 void ImageCapture::contextDestroyed(ExecutionContext*) { |
| 94 removeAllEventListeners(); | 94 removeAllEventListeners(); |
| 95 m_serviceRequests.clear(); | 95 m_serviceRequests.clear(); |
| 96 DCHECK(!hasEventListeners()); | 96 DCHECK(!hasEventListeners()); |
| 97 } | 97 } |
| 98 | 98 |
| 99 ScriptPromise ImageCapture::getPhotoCapabilities( | 99 ScriptPromise ImageCapture::getPhotoCapabilities( |
| 100 ScriptState* scriptState, | 100 ScriptState* scriptState, |
| 101 ExceptionState& exceptionState) { | 101 ExceptionState& exceptionState) { |
| 102 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); | 102 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
| 103 ScriptPromise promise = resolver->promise(); | 103 ScriptPromise promise = resolver->promise(); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 381 } |
| 382 | 382 |
| 383 DEFINE_TRACE(ImageCapture) { | 383 DEFINE_TRACE(ImageCapture) { |
| 384 visitor->trace(m_streamTrack); | 384 visitor->trace(m_streamTrack); |
| 385 visitor->trace(m_serviceRequests); | 385 visitor->trace(m_serviceRequests); |
| 386 EventTargetWithInlineData::trace(visitor); | 386 EventTargetWithInlineData::trace(visitor); |
| 387 ContextLifecycleObserver::trace(visitor); | 387 ContextLifecycleObserver::trace(visitor); |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace blink | 390 } // namespace blink |
| OLD | NEW |