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

Unified Diff: chrome/browser/resources/hangout_services/thunk.js

Issue 264793017: Implements RTP header dumping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix leak Created 6 years, 7 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 | « chrome/browser/media/webrtc_rtp_dump_writer_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/hangout_services/thunk.js
diff --git a/chrome/browser/resources/hangout_services/thunk.js b/chrome/browser/resources/hangout_services/thunk.js
index 80457d4f00a95bfe8d18ebf3ec26bf99f4f7dff0..bda691165f7ca3b5b35d97c1d73ac42bfae9b01f 100644
--- a/chrome/browser/resources/hangout_services/thunk.js
+++ b/chrome/browser/resources/hangout_services/thunk.js
@@ -75,9 +75,11 @@ chrome.runtime.onMessageExternal.addListener(
sender.tab.id, origin, doSendResponse);
return true;
} else if (method == 'logging.stopAndUpload') {
- chrome.webrtcLoggingPrivate.stop(sender.tab.id, origin, function() {
- chrome.webrtcLoggingPrivate.upload(
- sender.tab.id, origin, doSendResponse);
+ stopAllRtpDump(sender.tab.id, origin, function() {
+ chrome.webrtcLoggingPrivate.stop(sender.tab.id, origin, function() {
+ chrome.webrtcLoggingPrivate.upload(
+ sender.tab.id, origin, doSendResponse);
+ });
});
return true;
} else if (method == 'logging.discard') {
@@ -115,6 +117,18 @@ chrome.runtime.onMessageExternal.addListener(
doSendResponse(obj.nacl_arch);
});
return true;
+ } else if (method == 'logging.startRtpDump') {
+ var incoming = message['incoming'] || false;
+ var outgoing = message['outgoing'] || false;
+ chrome.webrtcLoggingPrivate.startRtpDump(
+ sender.tab.id, origin, incoming, outgoing, doSendResponse);
+ return true;
+ } else if (method == 'logging.stopRtpDump') {
+ var incoming = message['incoming'] || false;
+ var outgoing = message['outgoing'] || false;
+ chrome.webrtcLoggingPrivate.stopRtpDump(
+ sender.tab.id, origin, incoming, outgoing, doSendResponse);
+ return true;
}
throw new Error('Unknown method: ' + method);
} catch (e) {
@@ -208,6 +222,17 @@ function onProcessCpu(port) {
});
}
+function stopAllRtpDump(tabId, origin, callback) {
+ // Stops incoming and outgoing separately, otherwise stopRtpDump will fail if
+ // either type of dump has not been started.
+ chrome.webrtcLoggingPrivate.stopRtpDump(
+ tabId, origin, true, false,
+ function() {
+ chrome.webrtcLoggingPrivate.stopRtpDump(
+ tabId, origin, false, true, callback);
+ });
+}
+
chrome.runtime.onConnectExternal.addListener(function(port) {
if (port.name == 'onSinksChangedListener') {
onSinksChangedPort(port);
« no previous file with comments | « chrome/browser/media/webrtc_rtp_dump_writer_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698