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); |