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 30 matching lines...) Expand all Loading... | |
41 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 class Dictionary; | 45 class Dictionary; |
46 class Document; | 46 class Document; |
47 class ExceptionState; | 47 class ExceptionState; |
48 class MediaStreamDescriptor; | 48 class MediaStreamDescriptor; |
49 class UserMediaController; | 49 class UserMediaController; |
50 | 50 |
51 class UserMediaRequest FINAL : public RefCounted<UserMediaRequest>, public Conte xtLifecycleObserver { | 51 class UserMediaRequest FINAL : public RefCountedWillBeGarbageCollectedFinalized< UserMediaRequest>, public ContextLifecycleObserver { |
52 DECLARE_GC_INFO; | |
52 public: | 53 public: |
53 static PassRefPtr<UserMediaRequest> create(ExecutionContext*, UserMediaContr oller*, const Dictionary& options, PassOwnPtr<NavigatorUserMediaSuccessCallback> , PassOwnPtr<NavigatorUserMediaErrorCallback>, ExceptionState&); | 54 static PassRefPtrWillBeRawPtr<UserMediaRequest> create(ExecutionContext*, Us erMediaController*, const Dictionary& options, PassOwnPtr<NavigatorUserMediaSucc essCallback>, PassOwnPtr<NavigatorUserMediaErrorCallback>, ExceptionState&); |
54 virtual ~UserMediaRequest(); | 55 virtual ~UserMediaRequest(); |
55 | 56 |
56 NavigatorUserMediaSuccessCallback* successCallback() const { return m_succes sCallback.get(); } | 57 NavigatorUserMediaSuccessCallback* successCallback() const { return m_succes sCallback.get(); } |
57 NavigatorUserMediaErrorCallback* errorCallback() const { return m_errorCallb ack.get(); } | 58 NavigatorUserMediaErrorCallback* errorCallback() const { return m_errorCallb ack.get(); } |
58 Document* ownerDocument(); | 59 Document* ownerDocument(); |
59 | 60 |
60 void start(); | 61 void start(); |
61 | 62 |
62 void succeed(PassRefPtr<MediaStreamDescriptor>); | 63 void succeed(PassRefPtr<MediaStreamDescriptor>); |
63 void fail(const String& description); | 64 void fail(const String& description); |
64 void failConstraint(const String& constraintName, const String& description) ; | 65 void failConstraint(const String& constraintName, const String& description) ; |
65 | 66 |
66 bool audio() const; | 67 bool audio() const; |
67 bool video() const; | 68 bool video() const; |
68 blink::WebMediaConstraints audioConstraints() const; | 69 blink::WebMediaConstraints audioConstraints() const; |
69 blink::WebMediaConstraints videoConstraints() const; | 70 blink::WebMediaConstraints videoConstraints() const; |
70 | 71 |
71 // ContextLifecycleObserver | 72 // ContextLifecycleObserver |
72 virtual void contextDestroyed() OVERRIDE; | 73 virtual void contextDestroyed() OVERRIDE; |
73 | 74 |
75 void trace(Visitor*) { } | |
76 | |
74 private: | 77 private: |
75 UserMediaRequest(ExecutionContext*, UserMediaController*, blink::WebMediaCon straints audio, blink::WebMediaConstraints video, PassOwnPtr<NavigatorUserMediaS uccessCallback>, PassOwnPtr<NavigatorUserMediaErrorCallback>); | 78 UserMediaRequest(ExecutionContext*, UserMediaController*, blink::WebMediaCon straints audio, blink::WebMediaConstraints video, PassOwnPtr<NavigatorUserMediaS uccessCallback>, PassOwnPtr<NavigatorUserMediaErrorCallback>); |
76 | 79 |
77 blink::WebMediaConstraints m_audio; | 80 blink::WebMediaConstraints m_audio; |
78 blink::WebMediaConstraints m_video; | 81 blink::WebMediaConstraints m_video; |
79 | 82 |
80 UserMediaController* m_controller; | 83 UserMediaController* m_controller; |
haraken
2014/02/21 10:47:05
This raw pointer looks safe because it's cleared i
| |
81 | 84 |
82 OwnPtr<NavigatorUserMediaSuccessCallback> m_successCallback; | 85 OwnPtr<NavigatorUserMediaSuccessCallback> m_successCallback; |
83 OwnPtr<NavigatorUserMediaErrorCallback> m_errorCallback; | 86 OwnPtr<NavigatorUserMediaErrorCallback> m_errorCallback; |
84 }; | 87 }; |
85 | 88 |
86 } // namespace WebCore | 89 } // namespace WebCore |
87 | 90 |
88 #endif // UserMediaRequest_h | 91 #endif // UserMediaRequest_h |
OLD | NEW |