OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 12 matching lines...) Expand all Loading... |
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 RTCDTMFSender_h | 26 #ifndef RTCDTMFSender_h |
27 #define RTCDTMFSender_h | 27 #define RTCDTMFSender_h |
28 | 28 |
29 #include "core/dom/ActiveDOMObject.h" | 29 #include "core/dom/ActiveDOMObject.h" |
30 #include "modules/EventTargetModules.h" | 30 #include "modules/EventTargetModules.h" |
31 #include "platform/Timer.h" | 31 #include "platform/Timer.h" |
32 #include "public/platform/WebRTCDTMFSenderHandlerClient.h" | 32 #include "public/platform/WebRTCDTMFSenderHandlerClient.h" |
| 33 #include <memory> |
33 | 34 |
34 namespace blink { | 35 namespace blink { |
35 | 36 |
36 class ExceptionState; | 37 class ExceptionState; |
37 class MediaStreamTrack; | 38 class MediaStreamTrack; |
38 class WebRTCDTMFSenderHandler; | 39 class WebRTCDTMFSenderHandler; |
39 class WebRTCPeerConnectionHandler; | 40 class WebRTCPeerConnectionHandler; |
40 | 41 |
41 class RTCDTMFSender final | 42 class RTCDTMFSender final |
42 : public EventTargetWithInlineData | 43 : public EventTargetWithInlineData |
(...skipping 21 matching lines...) Expand all Loading... |
64 // EventTarget | 65 // EventTarget |
65 const AtomicString& interfaceName() const override; | 66 const AtomicString& interfaceName() const override; |
66 ExecutionContext* getExecutionContext() const override; | 67 ExecutionContext* getExecutionContext() const override; |
67 | 68 |
68 // ActiveDOMObject | 69 // ActiveDOMObject |
69 void stop() override; | 70 void stop() override; |
70 | 71 |
71 DECLARE_VIRTUAL_TRACE(); | 72 DECLARE_VIRTUAL_TRACE(); |
72 | 73 |
73 private: | 74 private: |
74 RTCDTMFSender(ExecutionContext*, MediaStreamTrack*, PassOwnPtr<WebRTCDTMFSen
derHandler>); | 75 RTCDTMFSender(ExecutionContext*, MediaStreamTrack*, std::unique_ptr<WebRTCDT
MFSenderHandler>); |
75 void dispose(); | 76 void dispose(); |
76 | 77 |
77 void scheduleDispatchEvent(Event*); | 78 void scheduleDispatchEvent(Event*); |
78 void scheduledEventTimerFired(Timer<RTCDTMFSender>*); | 79 void scheduledEventTimerFired(Timer<RTCDTMFSender>*); |
79 | 80 |
80 // WebRTCDTMFSenderHandlerClient | 81 // WebRTCDTMFSenderHandlerClient |
81 void didPlayTone(const WebString&) override; | 82 void didPlayTone(const WebString&) override; |
82 | 83 |
83 Member<MediaStreamTrack> m_track; | 84 Member<MediaStreamTrack> m_track; |
84 int m_duration; | 85 int m_duration; |
85 int m_interToneGap; | 86 int m_interToneGap; |
86 | 87 |
87 OwnPtr<WebRTCDTMFSenderHandler> m_handler; | 88 std::unique_ptr<WebRTCDTMFSenderHandler> m_handler; |
88 | 89 |
89 bool m_stopped; | 90 bool m_stopped; |
90 | 91 |
91 Timer<RTCDTMFSender> m_scheduledEventTimer; | 92 Timer<RTCDTMFSender> m_scheduledEventTimer; |
92 HeapVector<Member<Event>> m_scheduledEvents; | 93 HeapVector<Member<Event>> m_scheduledEvents; |
93 }; | 94 }; |
94 | 95 |
95 } // namespace blink | 96 } // namespace blink |
96 | 97 |
97 #endif // RTCDTMFSender_h | 98 #endif // RTCDTMFSender_h |
OLD | NEW |