| 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 25 matching lines...) Expand all  Loading... | 
| 36 namespace blink { | 36 namespace blink { | 
| 37 class WebRTCDTMFSenderHandler; | 37 class WebRTCDTMFSenderHandler; | 
| 38 class WebRTCPeerConnectionHandler; | 38 class WebRTCPeerConnectionHandler; | 
| 39 } | 39 } | 
| 40 | 40 | 
| 41 namespace WebCore { | 41 namespace WebCore { | 
| 42 | 42 | 
| 43 class ExceptionState; | 43 class ExceptionState; | 
| 44 class MediaStreamTrack; | 44 class MediaStreamTrack; | 
| 45 | 45 | 
| 46 class RTCDTMFSender FINAL : public RefCounted<RTCDTMFSender>, public ScriptWrapp
    able, public EventTargetWithInlineData, public blink::WebRTCDTMFSenderHandlerCli
    ent, public ActiveDOMObject { | 46 class RTCDTMFSender FINAL : public RefCountedWillBeRefCountedGarbageCollected<RT
    CDTMFSender>, public ScriptWrappable, public EventTargetWithInlineData, public b
    link::WebRTCDTMFSenderHandlerClient, public ActiveDOMObject { | 
| 47     REFCOUNTED_EVENT_TARGET(RTCDTMFSender); | 47     DECLARE_GC_INFO; | 
|  | 48     DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<R
    TCDTMFSender>); | 
| 48 public: | 49 public: | 
| 49     static PassRefPtr<RTCDTMFSender> create(ExecutionContext*, blink::WebRTCPeer
    ConnectionHandler*, PassRefPtr<MediaStreamTrack>, ExceptionState&); | 50     static PassRefPtrWillBeRawPtr<RTCDTMFSender> create(ExecutionContext*, blink
    ::WebRTCPeerConnectionHandler*, PassRefPtrWillBeRawPtr<MediaStreamTrack>, Except
    ionState&); | 
| 50     virtual ~RTCDTMFSender(); | 51     virtual ~RTCDTMFSender(); | 
| 51 | 52 | 
| 52     bool canInsertDTMF() const; | 53     bool canInsertDTMF() const; | 
| 53     MediaStreamTrack* track() const; | 54     MediaStreamTrack* track() const; | 
| 54     String toneBuffer() const; | 55     String toneBuffer() const; | 
| 55     long duration() const { return m_duration; } | 56     long duration() const { return m_duration; } | 
| 56     long interToneGap() const { return m_interToneGap; } | 57     long interToneGap() const { return m_interToneGap; } | 
| 57 | 58 | 
| 58     void insertDTMF(const String& tones, ExceptionState&); | 59     void insertDTMF(const String& tones, ExceptionState&); | 
| 59     void insertDTMF(const String& tones, long duration, ExceptionState&); | 60     void insertDTMF(const String& tones, long duration, ExceptionState&); | 
| 60     void insertDTMF(const String& tones, long duration, long interToneGap, Excep
    tionState&); | 61     void insertDTMF(const String& tones, long duration, long interToneGap, Excep
    tionState&); | 
| 61 | 62 | 
| 62     DEFINE_ATTRIBUTE_EVENT_LISTENER(tonechange); | 63     DEFINE_ATTRIBUTE_EVENT_LISTENER(tonechange); | 
| 63 | 64 | 
| 64     // EventTarget | 65     // EventTarget | 
| 65     virtual const AtomicString& interfaceName() const OVERRIDE; | 66     virtual const AtomicString& interfaceName() const OVERRIDE; | 
| 66     virtual ExecutionContext* executionContext() const OVERRIDE; | 67     virtual ExecutionContext* executionContext() const OVERRIDE; | 
| 67 | 68 | 
| 68     // ActiveDOMObject | 69     // ActiveDOMObject | 
| 69     virtual void stop() OVERRIDE; | 70     virtual void stop() OVERRIDE; | 
| 70 | 71 | 
|  | 72     void trace(Visitor*); | 
|  | 73 | 
| 71 private: | 74 private: | 
| 72     RTCDTMFSender(ExecutionContext*, PassRefPtr<MediaStreamTrack>, PassOwnPtr<bl
    ink::WebRTCDTMFSenderHandler>); | 75     RTCDTMFSender(ExecutionContext*, PassRefPtrWillBeRawPtr<MediaStreamTrack>, P
    assOwnPtr<blink::WebRTCDTMFSenderHandler>); | 
| 73 | 76 | 
| 74     void scheduleDispatchEvent(PassRefPtr<Event>); | 77     void scheduleDispatchEvent(PassRefPtr<Event>); | 
| 75     void scheduledEventTimerFired(Timer<RTCDTMFSender>*); | 78     void scheduledEventTimerFired(Timer<RTCDTMFSender>*); | 
| 76 | 79 | 
| 77     // blink::WebRTCDTMFSenderHandlerClient | 80     // blink::WebRTCDTMFSenderHandlerClient | 
| 78     virtual void didPlayTone(const blink::WebString&) OVERRIDE; | 81     virtual void didPlayTone(const blink::WebString&) OVERRIDE; | 
| 79 | 82 | 
| 80     RefPtr<MediaStreamTrack> m_track; | 83     RefPtrWillBeMember<MediaStreamTrack> m_track; | 
| 81     long m_duration; | 84     long m_duration; | 
| 82     long m_interToneGap; | 85     long m_interToneGap; | 
| 83 | 86 | 
| 84     OwnPtr<blink::WebRTCDTMFSenderHandler> m_handler; | 87     OwnPtr<blink::WebRTCDTMFSenderHandler> m_handler; | 
| 85 | 88 | 
| 86     bool m_stopped; | 89     bool m_stopped; | 
| 87 | 90 | 
| 88     Timer<RTCDTMFSender> m_scheduledEventTimer; | 91     Timer<RTCDTMFSender> m_scheduledEventTimer; | 
| 89     Vector<RefPtr<Event> > m_scheduledEvents; | 92     Vector<RefPtr<Event> > m_scheduledEvents; | 
| 90 }; | 93 }; | 
| 91 | 94 | 
| 92 } // namespace WebCore | 95 } // namespace WebCore | 
| 93 | 96 | 
| 94 #endif // RTCDTMFSender_h | 97 #endif // RTCDTMFSender_h | 
| OLD | NEW | 
|---|