OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_H_ | |
6 #define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/compiler_specific.h" | |
12 #include "base/gtest_prod_util.h" | |
13 #include "content/common/content_export.h" | |
14 #include "content/renderer/media/peer_connection_handler_base.h" | |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" | |
16 | |
17 // PeerConnectionHandler is a delegate for the ROAP PeerConnection API messages | |
18 // going between WebKit and native PeerConnection in libjingle. It's owned by | |
19 // WebKit. ROAP PeerConnection will be removed soon. | |
20 class CONTENT_EXPORT PeerConnectionHandler | |
21 : public PeerConnectionHandlerBase, | |
22 NON_EXPORTED_BASE(public WebKit::WebPeerConnectionHandler) { | |
23 public: | |
24 PeerConnectionHandler( | |
25 WebKit::WebPeerConnectionHandlerClient* client, | |
26 MediaStreamDependencyFactory* dependency_factory); | |
27 virtual ~PeerConnectionHandler(); | |
28 | |
29 // WebKit::WebPeerConnectionHandler implementation | |
30 virtual void initialize( | |
31 const WebKit::WebString& server_configuration, | |
32 const WebKit::WebString& username) OVERRIDE; | |
33 virtual void produceInitialOffer( | |
34 const WebKit::WebVector<WebKit::WebMediaStreamDescriptor>& | |
35 pending_add_streams) OVERRIDE; | |
36 virtual void handleInitialOffer(const WebKit::WebString& sdp) OVERRIDE; | |
37 virtual void processSDP(const WebKit::WebString& sdp) OVERRIDE; | |
38 virtual void processPendingStreams( | |
39 const WebKit::WebVector<WebKit::WebMediaStreamDescriptor>& | |
40 pending_add_streams, | |
41 const WebKit::WebVector<WebKit::WebMediaStreamDescriptor>& | |
42 pending_remove_streams) OVERRIDE; | |
43 virtual void sendDataStreamMessage(const char* data, size_t length) OVERRIDE; | |
44 // We will be deleted by WebKit after stop has been returned. | |
45 virtual void stop() OVERRIDE; | |
46 | |
47 // webrtc::PeerConnectionObserver implementation | |
48 virtual void OnError() OVERRIDE; | |
49 virtual void OnMessage(const std::string& msg) OVERRIDE; | |
50 virtual void OnSignalingMessage(const std::string& msg) OVERRIDE; | |
51 virtual void OnStateChange(StateType state_changed) OVERRIDE; | |
52 virtual void OnAddStream(webrtc::MediaStreamInterface* stream) OVERRIDE; | |
53 virtual void OnRemoveStream(webrtc::MediaStreamInterface* stream) OVERRIDE; | |
54 virtual void OnIceCandidate( | |
55 const webrtc::IceCandidateInterface* candidate) OVERRIDE; | |
56 virtual void OnIceComplete() OVERRIDE; | |
57 | |
58 private: | |
59 void OnAddStreamCallback(webrtc::MediaStreamInterface* stream); | |
60 void OnRemoveStreamCallback(webrtc::MediaStreamInterface* stream); | |
61 | |
62 // client_ is a weak pointer, and is valid until stop() has returned. | |
63 WebKit::WebPeerConnectionHandlerClient* client_; | |
64 | |
65 DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandler); | |
66 }; | |
67 | |
68 #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_H_ | |
OLD | NEW |