Ignore non-active fullscreen windows for shelf state.
[chromium-blink-merge.git] / content / browser / renderer_host / media / peer_connection_tracker_host.cc
blobb986055e700bb35a96203489552081314317e5e4
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 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h"
6 #include "content/browser/media/webrtc_internals.h"
7 #include "content/common/media/peer_connection_tracker_messages.h"
9 namespace content {
11 PeerConnectionTrackerHost::PeerConnectionTrackerHost(int render_process_id)
12 : render_process_id_(render_process_id) {}
14 bool PeerConnectionTrackerHost::OnMessageReceived(const IPC::Message& message,
15 bool* message_was_ok) {
16 bool handled = true;
18 IPC_BEGIN_MESSAGE_MAP_EX(PeerConnectionTrackerHost, message, *message_was_ok)
19 IPC_MESSAGE_HANDLER(PeerConnectionTrackerHost_AddPeerConnection,
20 OnAddPeerConnection)
21 IPC_MESSAGE_HANDLER(PeerConnectionTrackerHost_RemovePeerConnection,
22 OnRemovePeerConnection)
23 IPC_MESSAGE_HANDLER(PeerConnectionTrackerHost_UpdatePeerConnection,
24 OnUpdatePeerConnection)
25 IPC_MESSAGE_HANDLER(PeerConnectionTrackerHost_AddStats, OnAddStats)
26 IPC_MESSAGE_UNHANDLED(handled = false)
27 IPC_END_MESSAGE_MAP_EX()
28 return handled;
31 void PeerConnectionTrackerHost::OverrideThreadForMessage(
32 const IPC::Message& message, BrowserThread::ID* thread) {
33 if (IPC_MESSAGE_CLASS(message) == PeerConnectionTrackerMsgStart)
34 *thread = BrowserThread::UI;
37 PeerConnectionTrackerHost::~PeerConnectionTrackerHost() {
40 void PeerConnectionTrackerHost::OnAddPeerConnection(
41 const PeerConnectionInfo& info) {
42 WebRTCInternals::GetInstance()->OnAddPeerConnection(
43 render_process_id_,
44 peer_pid(),
45 info.lid,
46 info.url,
47 info.servers,
48 info.constraints);
51 void PeerConnectionTrackerHost::OnRemovePeerConnection(int lid) {
52 WebRTCInternals::GetInstance()->OnRemovePeerConnection(peer_pid(), lid);
55 void PeerConnectionTrackerHost::OnUpdatePeerConnection(
56 int lid, const std::string& type, const std::string& value) {
57 WebRTCInternals::GetInstance()->OnUpdatePeerConnection(
58 peer_pid(),
59 lid,
60 type,
61 value);
64 void PeerConnectionTrackerHost::OnAddStats(int lid,
65 const base::ListValue& value) {
66 WebRTCInternals::GetInstance()->OnAddStats(peer_pid(), lid, value);
69 } // namespace content