Commit 670f140e authored by jiayl@chromium.org's avatar jiayl@chromium.org

Remove the RTP recording related code from webrtc-internals.

The code is dead and we have no plan to implement RTP recording in the near term.
So removing to avoid confusion.

BUG=

Review URL: https://codereview.chromium.org/129533003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243876 0039d316-1c4b-4281-b951-d872f2087c98
parent d557d0c5
......@@ -35,8 +35,7 @@ static base::ListValue* EnsureLogList(base::DictionaryValue* dict) {
} // namespace
WebRTCInternals::WebRTCInternals()
: is_recording_rtp_(false),
aec_dump_enabled_(false) {
: aec_dump_enabled_(false) {
registrar_.Add(this, NOTIFICATION_RENDERER_PROCESS_TERMINATED,
NotificationService::AllBrowserContextsAndSources());
BrowserChildProcessObserver::Add(this);
......@@ -230,20 +229,6 @@ void WebRTCInternals::UpdateObserver(WebRTCInternalsUIObserver* observer) {
}
}
void WebRTCInternals::StartRtpRecording() {
if (!is_recording_rtp_) {
is_recording_rtp_ = true;
// TODO(justinlin): start RTP recording.
}
}
void WebRTCInternals::StopRtpRecording() {
if (is_recording_rtp_) {
is_recording_rtp_ = false;
// TODO(justinlin): stop RTP recording.
}
}
void WebRTCInternals::EnableAecDump(content::WebContents* web_contents) {
#if defined(ENABLE_WEBRTC)
select_file_dialog_ = ui::SelectFileDialog::Create(this, NULL);
......@@ -354,21 +339,11 @@ void WebRTCInternals::OnRendererExit(int render_process_id) {
}
}
// TODO(justlin): Calls this method as necessary to update the recording status
// UI.
void WebRTCInternals::SendRtpRecordingUpdate() {
DCHECK(is_recording_rtp_);
base::DictionaryValue update;
// TODO(justinlin): Fill in |update| with values as appropriate.
SendUpdate("updateDumpStatus", &update);
}
void WebRTCInternals::ResetForTesting() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
observers_.Clear();
peer_connection_data_.Clear();
get_user_media_requests_.Clear();
is_recording_rtp_ = false;
aec_dump_enabled_ = false;
}
......
......@@ -85,10 +85,6 @@ class CONTENT_EXPORT WebRTCInternals : public BrowserChildProcessObserver,
// Sends all update data to |observer|.
void UpdateObserver(WebRTCInternalsUIObserver* observer);
// Tells the renderer processes to start or stop recording RTP packets.
void StartRtpRecording();
void StopRtpRecording();
// Enables or disables AEC dump (diagnostic echo canceller recording).
void EnableAecDump(content::WebContents* web_contents);
void DisableAecDump();
......@@ -131,8 +127,6 @@ class CONTENT_EXPORT WebRTCInternals : public BrowserChildProcessObserver,
// Called when a renderer exits (including crashes).
void OnRendererExit(int render_process_id);
void SendRtpRecordingUpdate();
ObserverList<WebRTCInternalsUIObserver> observers_;
// |peer_connection_data_| is a list containing all the PeerConnection
......@@ -161,8 +155,6 @@ class CONTENT_EXPORT WebRTCInternals : public BrowserChildProcessObserver,
NotificationRegistrar registrar_;
bool is_recording_rtp_;
// For managing select file dialog.
scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
......
......@@ -27,13 +27,6 @@ void WebRTCInternalsMessageHandler::RegisterMessages() {
base::Bind(&WebRTCInternalsMessageHandler::OnGetAllStats,
base::Unretained(this)));
web_ui()->RegisterMessageCallback("startRtpRecording",
base::Bind(&WebRTCInternalsMessageHandler::OnStartRtpRecording,
base::Unretained(this)));
web_ui()->RegisterMessageCallback("stopRtpRecording",
base::Bind(&WebRTCInternalsMessageHandler::OnStopRtpRecording,
base::Unretained(this)));
web_ui()->RegisterMessageCallback("enableAecRecording",
base::Bind(&WebRTCInternalsMessageHandler::OnSetAecRecordingEnabled,
base::Unretained(this), true));
......@@ -56,16 +49,6 @@ void WebRTCInternalsMessageHandler::OnGetAllStats(
}
}
void WebRTCInternalsMessageHandler::OnStartRtpRecording(
const base::ListValue* /* unused_list */) {
WebRTCInternals::GetInstance()->StartRtpRecording();
}
void WebRTCInternalsMessageHandler::OnStopRtpRecording(
const base::ListValue* /* unused_list */) {
WebRTCInternals::GetInstance()->StopRtpRecording();
}
void WebRTCInternalsMessageHandler::OnSetAecRecordingEnabled(
bool enable, const base::ListValue* /* unused_list */) {
if (enable)
......
......@@ -33,8 +33,6 @@ class WebRTCInternalsMessageHandler : public WebUIMessageHandler,
private:
// Javascript message handler.
void OnGetAllStats(const base::ListValue* list);
void OnStartRtpRecording(const base::ListValue* list);
void OnStopRtpRecording(const base::ListValue* list);
void OnSetAecRecordingEnabled(bool enable, const base::ListValue* list);
void OnDOMLoadDone(const base::ListValue* list);
......
......@@ -4,9 +4,7 @@
/**
* Provides the UI to start and stop RTP recording, forwards the start/stop
* commands to Chrome, and updates the UI based on dump updates. Also provides
* creating a file containing all PeerConnection updates and stats.
* Provides the UI for dump creation.
*/
var DumpCreator = (function() {
/**
......@@ -15,30 +13,6 @@ var DumpCreator = (function() {
* @constructor
*/
function DumpCreator(containerElement) {
/**
* True if the RTP packets are being recorded.
* @type {bool}
* @private
*/
this.recording_ = false;
/**
* @type {!Object.<string>}
* @private
* @const
*/
this.StatusStrings_ = {
NOT_STARTED: 'not started.',
RECORDING: 'recording...',
},
/**
* The status of dump creation.
* @type {string}
* @private
*/
this.status_ = this.StatusStrings_.NOT_STARTED;
/**
* The root element of the dump creation UI.
* @type {Element}
......@@ -54,8 +28,7 @@ var DumpCreator = (function() {
var content = document.createElement('div');
this.root_.appendChild(content);
content.innerHTML = '<button disabled></button> Status: <span></span>' +
'<div><a><button>' +
content.innerHTML = '<div><a><button>' +
'Download the PeerConnection updates and stats data' +
'</button></a></div>' +
'<p><label><input type=checkbox>' +
......@@ -67,14 +40,10 @@ var DumpCreator = (function() {
' calls. When the box is unchecked or this page is closed, this' +
' recording functionality will be disabled.</p>';
content.getElementsByTagName('button')[0].addEventListener(
'click', this.onRtpToggled_.bind(this));
content.getElementsByTagName('a')[0].addEventListener(
'click', this.onDownloadData_.bind(this));
content.getElementsByTagName('input')[0].addEventListener(
'click', this.onAecRecordingChanged_.bind(this));
this.updateDisplay_();
}
DumpCreator.prototype = {
......@@ -97,24 +66,6 @@ var DumpCreator = (function() {
// The default action of the anchor will download the URL.
},
/**
* Handles the event of toggling the rtp recording state.
*
* @private
*/
onRtpToggled_: function() {
if (this.recording_) {
this.recording_ = false;
this.status_ = this.StatusStrings_.NOT_STARTED;
chrome.send('stopRtpRecording');
} else {
this.recording_ = true;
this.status_ = this.StatusStrings_.RECORDING;
chrome.send('startRtpRecording');
}
this.updateDisplay_();
},
/**
* Handles the event of toggling the AEC recording state.
*
......@@ -128,34 +79,6 @@ var DumpCreator = (function() {
chrome.send('disableAecRecording');
}
},
/**
* Updates the UI based on the recording status.
*
* @private
*/
updateDisplay_: function() {
if (this.recording_) {
this.root_.getElementsByTagName('button')[0].textContent =
'Stop Recording RTP Packets';
} else {
this.root_.getElementsByTagName('button')[0].textContent =
'Start Recording RTP Packets';
}
this.root_.getElementsByTagName('span')[0].textContent = this.status_;
},
/**
* Set the status to the content of the update.
* @param {!Object} update
*/
onUpdate: function(update) {
if (this.recording_) {
this.status_ = JSON.stringify(update);
this.updateDisplay_();
}
},
};
return DumpCreator;
})();
......@@ -264,16 +264,6 @@ function removeGetUserMediaForRenderer(data) {
// TODO(jiayl): remove the getUserMedia info from the tabbed UI.
}
/**
* Delegates to dumpCreator to update the recording status.
* @param {!Object.<string>} update Key-value pairs describing the status of the
* RTP recording.
*/
function updateDumpStatus(update) {
dumpCreator.onUpdate(update);
}
/**
* Set
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment