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

Unified Diff: content/browser/renderer_host/media/peer_connection_tracker_host.cc

Issue 11876007: Connecting webrtc-internals WebUI frontend with the backend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@main
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/media/peer_connection_tracker_host.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/peer_connection_tracker_host.cc
diff --git a/content/browser/renderer_host/media/peer_connection_tracker_host.cc b/content/browser/renderer_host/media/peer_connection_tracker_host.cc
index d4a8ac6b66e58097840d7be6acab4f58d63a57d5..ea692710b1a1cf79b2f470e2aae88fd8f805c61c 100644
--- a/content/browser/renderer_host/media/peer_connection_tracker_host.cc
+++ b/content/browser/renderer_host/media/peer_connection_tracker_host.cc
@@ -4,9 +4,9 @@
#include "content/browser/renderer_host/media/peer_connection_tracker_host.h"
#include "base/process_util.h"
-#include "content/browser/media/webrtc_internals.h"
#include "content/common/media/peer_connection_tracker_messages.h"
#include "content/public/browser/content_browser_client.h"
+#include "content/public/browser/webrtc_internals.h"
namespace content {
@@ -16,6 +16,7 @@ PeerConnectionTrackerHost::PeerConnectionTrackerHost() {
bool PeerConnectionTrackerHost::OnMessageReceived(const IPC::Message& message,
bool* message_was_ok) {
bool handled = true;
+
IPC_BEGIN_MESSAGE_MAP_EX(PeerConnectionTrackerHost, message, *message_was_ok)
IPC_MESSAGE_HANDLER(PeerConnectionTrackerHost_AddPeerConnection,
OnAddPeerConnection)
@@ -26,18 +27,34 @@ bool PeerConnectionTrackerHost::OnMessageReceived(const IPC::Message& message,
return handled;
}
+void PeerConnectionTrackerHost::OverrideThreadForMessage(
+ const IPC::Message& message, BrowserThread::ID* thread) {
+ if (IPC_MESSAGE_CLASS(message) == PeerConnectionTrackerMsgStart)
+ *thread = BrowserThread::UI;
+}
+
PeerConnectionTrackerHost::~PeerConnectionTrackerHost() {
}
void PeerConnectionTrackerHost::OnAddPeerConnection(
const PeerConnectionInfo& info) {
- WebRTCInternals::GetInstance()->AddPeerConnection(
- base::GetProcId(peer_handle()), info);
+ if (!GetContentClient()->browser()->GetWebRTCInternals())
+ return;
+
+ GetContentClient()->browser()->GetWebRTCInternals()->
+ AddPeerConnection(base::GetProcId(peer_handle()),
+ info.lid,
+ info.url,
+ info.servers,
+ info.constraints);
}
void PeerConnectionTrackerHost::OnRemovePeerConnection(int lid) {
- WebRTCInternals::GetInstance()->RemovePeerConnection(
- base::GetProcId(peer_handle()), lid);
+ if (!GetContentClient()->browser()->GetWebRTCInternals())
+ return;
+
+ GetContentClient()->browser()->GetWebRTCInternals()->
+ RemovePeerConnection(base::GetProcId(peer_handle()), lid);
}
} // namespace content
« no previous file with comments | « content/browser/renderer_host/media/peer_connection_tracker_host.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698