| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class Dictionary; | 44 class Dictionary; |
| 45 class Document; | 45 class Document; |
| 46 class ExceptionState; | 46 class ExceptionState; |
| 47 class MediaConstraints; | 47 class MediaConstraints; |
| 48 class MediaConstraintsImpl; | 48 class MediaConstraintsImpl; |
| 49 class MediaStreamDescriptor; | 49 class MediaStreamDescriptor; |
| 50 class UserMediaController; | 50 class UserMediaController; |
| 51 | 51 |
| 52 class UserMediaRequest : public RefCounted<UserMediaRequest>, public ContextLife
cycleObserver { | 52 class UserMediaRequest : public RefCounted<UserMediaRequest>, public ContextLife
cycleObserver { |
| 53 public: | 53 public: |
| 54 static PassRefPtr<UserMediaRequest> create(ExecutionContext*, UserMediaContr
oller*, const Dictionary& options, PassRefPtr<NavigatorUserMediaSuccessCallback>
, PassRefPtr<NavigatorUserMediaErrorCallback>, ExceptionState&); | 54 static PassRefPtr<UserMediaRequest> create(ExecutionContext*, UserMediaContr
oller*, const Dictionary& options, PassOwnPtr<NavigatorUserMediaSuccessCallback>
, PassOwnPtr<NavigatorUserMediaErrorCallback>, ExceptionState&); |
| 55 ~UserMediaRequest(); | 55 ~UserMediaRequest(); |
| 56 | 56 |
| 57 NavigatorUserMediaSuccessCallback* successCallback() const { return m_succes
sCallback.get(); } | 57 NavigatorUserMediaSuccessCallback* successCallback() const { return m_succes
sCallback.get(); } |
| 58 NavigatorUserMediaErrorCallback* errorCallback() const { return m_errorCallb
ack.get(); } | 58 NavigatorUserMediaErrorCallback* errorCallback() const { return m_errorCallb
ack.get(); } |
| 59 Document* ownerDocument(); | 59 Document* ownerDocument(); |
| 60 | 60 |
| 61 void start(); | 61 void start(); |
| 62 | 62 |
| 63 void succeed(PassRefPtr<MediaStreamDescriptor>); | 63 void succeed(PassRefPtr<MediaStreamDescriptor>); |
| 64 void fail(const String& description); | 64 void fail(const String& description); |
| 65 void failConstraint(const String& constraintName, const String& description)
; | 65 void failConstraint(const String& constraintName, const String& description)
; |
| 66 | 66 |
| 67 bool audio() const; | 67 bool audio() const; |
| 68 bool video() const; | 68 bool video() const; |
| 69 MediaConstraints* audioConstraints() const; | 69 MediaConstraints* audioConstraints() const; |
| 70 MediaConstraints* videoConstraints() const; | 70 MediaConstraints* videoConstraints() const; |
| 71 | 71 |
| 72 // ContextLifecycleObserver | 72 // ContextLifecycleObserver |
| 73 virtual void contextDestroyed(); | 73 virtual void contextDestroyed(); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 UserMediaRequest(ExecutionContext*, UserMediaController*, PassRefPtr<MediaCo
nstraintsImpl> audio, PassRefPtr<MediaConstraintsImpl> video, PassRefPtr<Navigat
orUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>); | 76 UserMediaRequest(ExecutionContext*, UserMediaController*, PassRefPtr<MediaCo
nstraintsImpl> audio, PassRefPtr<MediaConstraintsImpl> video, PassOwnPtr<Navigat
orUserMediaSuccessCallback>, PassOwnPtr<NavigatorUserMediaErrorCallback>); |
| 77 | 77 |
| 78 RefPtr<MediaConstraintsImpl> m_audio; | 78 RefPtr<MediaConstraintsImpl> m_audio; |
| 79 RefPtr<MediaConstraintsImpl> m_video; | 79 RefPtr<MediaConstraintsImpl> m_video; |
| 80 | 80 |
| 81 UserMediaController* m_controller; | 81 UserMediaController* m_controller; |
| 82 | 82 |
| 83 RefPtr<NavigatorUserMediaSuccessCallback> m_successCallback; | 83 OwnPtr<NavigatorUserMediaSuccessCallback> m_successCallback; |
| 84 RefPtr<NavigatorUserMediaErrorCallback> m_errorCallback; | 84 OwnPtr<NavigatorUserMediaErrorCallback> m_errorCallback; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace WebCore | 87 } // namespace WebCore |
| 88 | 88 |
| 89 #endif // UserMediaRequest_h | 89 #endif // UserMediaRequest_h |
| OLD | NEW |