| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef MediaDevicesRequest_h | 26 #ifndef MediaDevicesRequest_h |
| 27 #define MediaDevicesRequest_h | 27 #define MediaDevicesRequest_h |
| 28 | 28 |
| 29 #include "core/dom/ActiveDOMObject.h" | 29 #include "core/dom/ActiveDOMObject.h" |
| 30 #include "modules/mediastream/MediaDeviceInfo.h" | 30 #include "modules/mediastream/MediaDeviceInfo.h" |
| 31 #include "modules/mediastream/MediaDeviceInfoCallback.h" | 31 #include "modules/mediastream/MediaDeviceInfoCallback.h" |
| 32 #include "platform/heap/Handle.h" |
| 32 #include "wtf/PassOwnPtr.h" | 33 #include "wtf/PassOwnPtr.h" |
| 33 #include "wtf/PassRefPtr.h" | 34 #include "wtf/PassRefPtr.h" |
| 34 #include "wtf/RefCounted.h" | 35 #include "wtf/RefCounted.h" |
| 35 | 36 |
| 36 namespace WebCore { | 37 namespace WebCore { |
| 37 | 38 |
| 38 class Document; | 39 class Document; |
| 39 class ExceptionState; | 40 class ExceptionState; |
| 40 class MediaStreamDescriptor; | 41 class MediaStreamDescriptor; |
| 41 class UserMediaController; | 42 class UserMediaController; |
| 42 | 43 |
| 43 class MediaDevicesRequest FINAL : public RefCounted<MediaDevicesRequest>, public
ActiveDOMObject { | 44 class MediaDevicesRequest FINAL : public RefCountedWillBeRefCountedGarbageCollec
ted<MediaDevicesRequest>, public ActiveDOMObject { |
| 44 public: | 45 public: |
| 45 static PassRefPtr<MediaDevicesRequest> create(ExecutionContext*, UserMediaCo
ntroller*, PassOwnPtr<MediaDeviceInfoCallback>, ExceptionState&); | 46 static PassRefPtrWillBeRawPtr<MediaDevicesRequest> create(ExecutionContext*,
UserMediaController*, PassOwnPtr<MediaDeviceInfoCallback>, ExceptionState&); |
| 46 virtual ~MediaDevicesRequest(); | 47 virtual ~MediaDevicesRequest(); |
| 47 | 48 |
| 48 MediaDeviceInfoCallback* callback() const { return m_callback.get(); } | 49 MediaDeviceInfoCallback* callback() const { return m_callback.get(); } |
| 49 Document* ownerDocument(); | 50 Document* ownerDocument(); |
| 50 | 51 |
| 51 void start(); | 52 void start(); |
| 52 | 53 |
| 53 void succeed(const MediaDeviceInfoVector&); | 54 void succeed(const MediaDeviceInfoVector&); |
| 54 | 55 |
| 55 // ActiveDOMObject | 56 // ActiveDOMObject |
| 56 virtual void stop() OVERRIDE; | 57 virtual void stop() OVERRIDE; |
| 57 | 58 |
| 59 void trace(Visitor*) { } |
| 60 |
| 58 private: | 61 private: |
| 59 MediaDevicesRequest(ExecutionContext*, UserMediaController*, PassOwnPtr<Medi
aDeviceInfoCallback>); | 62 MediaDevicesRequest(ExecutionContext*, UserMediaController*, PassOwnPtr<Medi
aDeviceInfoCallback>); |
| 60 | 63 |
| 61 UserMediaController* m_controller; | 64 UserMediaController* m_controller; |
| 62 | 65 |
| 63 OwnPtr<MediaDeviceInfoCallback> m_callback; | 66 OwnPtr<MediaDeviceInfoCallback> m_callback; |
| 64 }; | 67 }; |
| 65 | 68 |
| 66 } // namespace WebCore | 69 } // namespace WebCore |
| 67 | 70 |
| 68 #endif // MediaDevicesRequest_h | 71 #endif // MediaDevicesRequest_h |
| OLD | NEW |