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

Unified Diff: trunk/src/chrome/browser/media/webrtc_log_uploader.cc

Issue 307063003: Revert 273745 "Implements RTP header dumping." due to memory leak (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
Index: trunk/src/chrome/browser/media/webrtc_log_uploader.cc
===================================================================
--- trunk/src/chrome/browser/media/webrtc_log_uploader.cc (revision 273764)
+++ trunk/src/chrome/browser/media/webrtc_log_uploader.cc (working copy)
@@ -36,36 +36,6 @@
const int kHttpResponseOk = 200;
-// Adds the header section for a gzip file to the multipart |post_data|.
-void AddMultipartFileContentHeader(std::string* post_data,
- const std::string& content_name) {
- post_data->append("--");
- post_data->append(kMultipartBoundary);
- post_data->append("\r\nContent-Disposition: form-data; name=\"");
- post_data->append(content_name);
- post_data->append("\"; filename=\"");
- post_data->append(content_name + ".gz");
- post_data->append("\"\r\nContent-Type: application/gzip\r\n\r\n");
-}
-
-// Adds |compressed_log| to |post_data|.
-void AddLogData(std::string* post_data,
- const std::vector<uint8>& compressed_log) {
- AddMultipartFileContentHeader(post_data, "webrtc_log");
- post_data->append(reinterpret_cast<const char*>(&compressed_log[0]),
- compressed_log.size());
- post_data->append("\r\n");
-}
-
-// Adds the RTP dump data to |post_data|.
-void AddRtpDumpData(std::string* post_data,
- const std::string& name,
- const std::string& dump_data) {
- AddMultipartFileContentHeader(post_data, name);
- post_data->append(dump_data.data(), dump_data.size());
- post_data->append("\r\n");
-}
-
} // namespace
WebRtcLogUploadDoneData::WebRtcLogUploadDoneData() {}
@@ -99,7 +69,6 @@
if (response_code == kHttpResponseOk &&
source->GetResponseAsString(&report_id) &&
!it->second.log_path.empty()) {
- // TODO(jiayl): Add the RTP dump records to chrome://webrtc-logs.
base::FilePath log_list_path =
WebRtcLogList::GetWebRtcLogListFileForDirectory(it->second.log_path);
content::BrowserThread::PostTask(
@@ -170,11 +139,7 @@
upload_done_data_with_log_id.local_log_id = local_log_id;
scoped_ptr<std::string> post_data(new std::string());
- SetupMultipart(post_data.get(),
- compressed_log,
- upload_done_data.incoming_rtp_dump,
- upload_done_data.outgoing_rtp_dump,
- meta_data);
+ SetupMultipart(post_data.get(), compressed_log, meta_data);
// If a test has set the test string pointer, write to it and skip uploading.
// Still fire the upload callback so that we can run an extension API test
@@ -216,8 +181,6 @@
void WebRtcLogUploader::SetupMultipart(
std::string* post_data,
const std::vector<uint8>& compressed_log,
- const base::FilePath& incoming_rtp_dump,
- const base::FilePath& outgoing_rtp_dump,
const std::map<std::string, std::string>& meta_data) {
#if defined(OS_WIN)
const char product[] = "Chrome";
@@ -254,22 +217,22 @@
}
AddLogData(post_data, compressed_log);
-
- // Add the rtp dumps if they exist.
- base::FilePath rtp_dumps[2] = {incoming_rtp_dump, outgoing_rtp_dump};
- static const char* kRtpDumpNames[2] = {"rtpdump_recv", "rtpdump_send"};
-
- for (size_t i = 0; i < 2; ++i) {
- if (!rtp_dumps[i].empty() && base::PathExists(rtp_dumps[i])) {
- std::string dump_data;
- if (base::ReadFileToString(rtp_dumps[i], &dump_data))
- AddRtpDumpData(post_data, kRtpDumpNames[i], dump_data);
- }
- }
-
net::AddMultipartFinalDelimiterForUpload(kMultipartBoundary, post_data);
}
+void WebRtcLogUploader::AddLogData(std::string* post_data,
+ const std::vector<uint8>& compressed_log) {
+ post_data->append("--");
+ post_data->append(kMultipartBoundary);
+ post_data->append("\r\n");
+ post_data->append("Content-Disposition: form-data; name=\"webrtc_log\"");
+ post_data->append("; filename=\"webrtc_log.gz\"\r\n");
+ post_data->append("Content-Type: application/gzip\r\n\r\n");
+ post_data->append(reinterpret_cast<const char*>(&compressed_log[0]),
+ compressed_log.size());
+ post_data->append("\r\n");
+}
+
void WebRtcLogUploader::CompressLog(std::vector<uint8>* compressed_log,
uint8* input,
uint32 input_size) {
« no previous file with comments | « trunk/src/chrome/browser/media/webrtc_log_uploader.h ('k') | trunk/src/chrome/browser/media/webrtc_log_uploader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698