Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" | 4 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" |
| 5 | 5 |
| 6 #include "base/process_util.h" | 6 #include "base/process_util.h" |
| 7 #include "content/browser/media/webrtc_internals.h" | |
| 8 #include "content/common/media/peer_connection_tracker_messages.h" | 7 #include "content/common/media/peer_connection_tracker_messages.h" |
| 9 #include "content/public/browser/content_browser_client.h" | 8 #include "content/public/browser/content_browser_client.h" |
| 9 #include "content/public/browser/webrtc_internals_interface.h" | |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 PeerConnectionTrackerHost::PeerConnectionTrackerHost() { | 13 PeerConnectionTrackerHost::PeerConnectionTrackerHost() { |
| 14 } | 14 } |
| 15 | 15 |
| 16 bool PeerConnectionTrackerHost::OnMessageReceived(const IPC::Message& message, | 16 bool PeerConnectionTrackerHost::OnMessageReceived(const IPC::Message& message, |
| 17 bool* message_was_ok) { | 17 bool* message_was_ok) { |
| 18 bool handled = true; | 18 bool handled = true; |
| 19 IPC_BEGIN_MESSAGE_MAP_EX(PeerConnectionTrackerHost, message, *message_was_ok) | 19 IPC_BEGIN_MESSAGE_MAP_EX(PeerConnectionTrackerHost, message, *message_was_ok) |
| 20 IPC_MESSAGE_HANDLER(PeerConnectionTrackerHost_AddPeerConnection, | 20 IPC_MESSAGE_HANDLER(PeerConnectionTrackerHost_AddPeerConnection, |
| 21 OnAddPeerConnection) | 21 OnAddPeerConnection) |
| 22 IPC_MESSAGE_HANDLER(PeerConnectionTrackerHost_RemovePeerConnection, | 22 IPC_MESSAGE_HANDLER(PeerConnectionTrackerHost_RemovePeerConnection, |
| 23 OnRemovePeerConnection) | 23 OnRemovePeerConnection) |
| 24 IPC_MESSAGE_UNHANDLED(handled = false) | 24 IPC_MESSAGE_UNHANDLED(handled = false) |
| 25 IPC_END_MESSAGE_MAP_EX() | 25 IPC_END_MESSAGE_MAP_EX() |
| 26 return handled; | 26 return handled; |
| 27 } | 27 } |
| 28 | 28 |
| 29 PeerConnectionTrackerHost::~PeerConnectionTrackerHost() { | 29 PeerConnectionTrackerHost::~PeerConnectionTrackerHost() { |
| 30 } | 30 } |
| 31 | 31 |
| 32 void PeerConnectionTrackerHost::OnAddPeerConnection( | 32 void PeerConnectionTrackerHost::OnAddPeerConnection( |
| 33 const PeerConnectionInfo& info) { | 33 const PeerConnectionInfo& info) { |
| 34 WebRTCInternals::GetInstance()->AddPeerConnection( | 34 GetContentClient()->browser()->GetWebRTCInternalsInterface() |
| 35 base::GetProcId(peer_handle()), info); | 35 ->AddPeerConnection(base::GetProcId(peer_handle()), |
|
vrk (LEFT CHROMIUM)
2013/01/15 22:54:13
nit: move the -> to the line before
jiayl
2013/01/15 23:03:31
Done.
| |
| 36 info.lid, | |
| 37 info.url, | |
| 38 info.servers, | |
| 39 info.constraints); | |
| 36 } | 40 } |
| 37 | 41 |
| 38 void PeerConnectionTrackerHost::OnRemovePeerConnection(int lid) { | 42 void PeerConnectionTrackerHost::OnRemovePeerConnection(int lid) { |
| 39 WebRTCInternals::GetInstance()->RemovePeerConnection( | 43 GetContentClient()->browser()->GetWebRTCInternalsInterface() |
| 40 base::GetProcId(peer_handle()), lid); | 44 ->RemovePeerConnection(base::GetProcId(peer_handle()), lid); |
|
vrk (LEFT CHROMIUM)
2013/01/15 22:54:13
nit: move the -> to the line before
jiayl
2013/01/15 23:03:31
Done.
| |
| 41 } | 45 } |
| 42 | 46 |
| 43 } // namespace content | 47 } // namespace content |
| OLD | NEW |