Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1012)

Side by Side Diff: Source/modules/mediastream/RTCPeerConnection.h

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 * 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 class MediaStreamTrack; 49 class MediaStreamTrack;
50 class RTCConfiguration; 50 class RTCConfiguration;
51 class RTCDTMFSender; 51 class RTCDTMFSender;
52 class RTCDataChannel; 52 class RTCDataChannel;
53 class RTCErrorCallback; 53 class RTCErrorCallback;
54 class RTCSessionDescription; 54 class RTCSessionDescription;
55 class RTCSessionDescriptionCallback; 55 class RTCSessionDescriptionCallback;
56 class RTCStatsCallback; 56 class RTCStatsCallback;
57 class VoidCallback; 57 class VoidCallback;
58 58
59 class RTCPeerConnection : public RefCounted<RTCPeerConnection>, public ScriptWra ppable, public RTCPeerConnectionHandlerClient, public EventTarget, public Active DOMObject { 59 class RTCPeerConnection : public RefCounted<RTCPeerConnection>, public ScriptWra ppable, public RTCPeerConnectionHandlerClient, public EventTargetWithInlineData, public ActiveDOMObject {
60 public: 60 public:
61 static PassRefPtr<RTCPeerConnection> create(ScriptExecutionContext*, const D ictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState& ); 61 static PassRefPtr<RTCPeerConnection> create(ScriptExecutionContext*, const D ictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState& );
62 ~RTCPeerConnection(); 62 ~RTCPeerConnection();
63 63
64 void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCEr rorCallback>, const Dictionary& mediaConstraints, ExceptionState&); 64 void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCEr rorCallback>, const Dictionary& mediaConstraints, ExceptionState&);
65 65
66 void createAnswer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCE rrorCallback>, const Dictionary& mediaConstraints, ExceptionState&); 66 void createAnswer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCE rrorCallback>, const Dictionary& mediaConstraints, ExceptionState&);
67 67
68 void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidC allback>, PassRefPtr<RTCErrorCallback>, ExceptionState&); 68 void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidC allback>, PassRefPtr<RTCErrorCallback>, ExceptionState&);
69 PassRefPtr<RTCSessionDescription> localDescription(ExceptionState&); 69 PassRefPtr<RTCSessionDescription> localDescription(ExceptionState&);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 private: 134 private:
135 RTCPeerConnection(ScriptExecutionContext*, PassRefPtr<RTCConfiguration>, Pas sRefPtr<MediaConstraints>, ExceptionState&); 135 RTCPeerConnection(ScriptExecutionContext*, PassRefPtr<RTCConfiguration>, Pas sRefPtr<MediaConstraints>, ExceptionState&);
136 136
137 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con figuration, ExceptionState&); 137 static PassRefPtr<RTCConfiguration> parseConfiguration(const Dictionary& con figuration, ExceptionState&);
138 void scheduleDispatchEvent(PassRefPtr<Event>); 138 void scheduleDispatchEvent(PassRefPtr<Event>);
139 void scheduledEventTimerFired(Timer<RTCPeerConnection>*); 139 void scheduledEventTimerFired(Timer<RTCPeerConnection>*);
140 bool hasLocalStreamWithTrackId(const String& trackId); 140 bool hasLocalStreamWithTrackId(const String& trackId);
141 141
142 // EventTarget implementation. 142 // EventTarget implementation.
143 virtual EventTargetData* eventTargetData(); 143 virtual void refEventTarget() OVERRIDE { ref(); }
144 virtual EventTargetData* ensureEventTargetData(); 144 virtual void derefEventTarget() OVERRIDE { deref(); }
145 virtual void refEventTarget() { ref(); }
146 virtual void derefEventTarget() { deref(); }
147 EventTargetData m_eventTargetData;
148 145
149 void changeSignalingState(SignalingState); 146 void changeSignalingState(SignalingState);
150 void changeIceGatheringState(IceGatheringState); 147 void changeIceGatheringState(IceGatheringState);
151 void changeIceConnectionState(IceConnectionState); 148 void changeIceConnectionState(IceConnectionState);
152 149
153 SignalingState m_signalingState; 150 SignalingState m_signalingState;
154 IceGatheringState m_iceGatheringState; 151 IceGatheringState m_iceGatheringState;
155 IceConnectionState m_iceConnectionState; 152 IceConnectionState m_iceConnectionState;
156 153
157 MediaStreamVector m_localStreams; 154 MediaStreamVector m_localStreams;
158 MediaStreamVector m_remoteStreams; 155 MediaStreamVector m_remoteStreams;
159 156
160 Vector<RefPtr<RTCDataChannel> > m_dataChannels; 157 Vector<RefPtr<RTCDataChannel> > m_dataChannels;
161 158
162 OwnPtr<RTCPeerConnectionHandler> m_peerHandler; 159 OwnPtr<RTCPeerConnectionHandler> m_peerHandler;
163 160
164 Timer<RTCPeerConnection> m_scheduledEventTimer; 161 Timer<RTCPeerConnection> m_scheduledEventTimer;
165 Vector<RefPtr<Event> > m_scheduledEvents; 162 Vector<RefPtr<Event> > m_scheduledEvents;
166 163
167 bool m_stopped; 164 bool m_stopped;
168 }; 165 };
169 166
170 } // namespace WebCore 167 } // namespace WebCore
171 168
172 #endif // RTCPeerConnection_h 169 #endif // RTCPeerConnection_h
OLDNEW
« no previous file with comments | « Source/modules/mediastream/RTCDataChannel.cpp ('k') | Source/modules/mediastream/RTCPeerConnection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698