1 // Copyright (c) 2013 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_BROWSER_RENDERER_HOST_MEDIA_PEER_CONNECTION_TRACKER_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_PEER_CONNECTION_TRACKER_HOST_H_ 7 8 #include "content/public/browser/browser_message_filter.h" 9 10 struct PeerConnectionInfo; 11 12 namespace base { 13 class ListValue; 14 } // namespace base 15 16 namespace content { 17 18 // This class is the host for PeerConnectionTracker in the browser process 19 // managed by RenderProcessHostImpl. It passes IPC messages between 20 // WebRTCInternals and PeerConnectionTracker. 21 class PeerConnectionTrackerHost : public BrowserMessageFilter { 22 public: 23 PeerConnectionTrackerHost(int render_process_id); 24 25 // content::BrowserMessageFilter override. 26 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 27 virtual void OverrideThreadForMessage(const IPC::Message& message, 28 BrowserThread::ID* thread) OVERRIDE; 29 30 protected: 31 virtual ~PeerConnectionTrackerHost(); 32 33 private: 34 // Handlers for peer connection messages coming from the renderer. 35 void OnAddPeerConnection(const PeerConnectionInfo& info); 36 void OnRemovePeerConnection(int lid); 37 void OnUpdatePeerConnection( 38 int lid, const std::string& type, const std::string& value); 39 void OnAddStats(int lid, const base::ListValue& value); 40 void OnGetUserMedia(const std::string& origin, 41 bool audio, 42 bool video, 43 const std::string& audio_constraints, 44 const std::string& video_constraints); 45 46 int render_process_id_; 47 48 DISALLOW_COPY_AND_ASSIGN(PeerConnectionTrackerHost); 49 }; 50 51 } // namespace content 52 53 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_PEER_CONNECTION_TRACKER_HOST_H_ 54