1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
# Disables WebRTC log uploading to Google
--- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig
+++ chrome/browser/media/webrtc/webrtc_log_uploader.cc
@@ -127,28 +127,11 @@ void WebRtcLogUploader::LoggingStoppedDo
DCHECK(meta_data.get());
DCHECK(!upload_done_data.paths.directory.empty());
- std::string compressed_log = CompressLog(log_buffer.get());
-
- std::string local_log_id;
-
if (base::PathExists(upload_done_data.paths.directory)) {
webrtc_logging::DeleteOldWebRtcLogFiles(upload_done_data.paths.directory);
-
- local_log_id = base::NumberToString(base::Time::Now().ToDoubleT());
- base::FilePath log_file_path =
- upload_done_data.paths.directory.AppendASCII(local_log_id)
- .AddExtension(FILE_PATH_LITERAL(".gz"));
- WriteCompressedLogToFile(compressed_log, log_file_path);
-
- base::FilePath log_list_path =
- webrtc_logging::TextLogList::GetWebRtcLogListFileForDirectory(
- upload_done_data.paths.directory);
- AddLocallyStoredLogInfoToUploadListFile(log_list_path, local_log_id);
}
- upload_done_data.local_log_id = local_log_id;
- PrepareMultipartPostData(compressed_log, std::move(meta_data),
- std::move(upload_done_data));
+ NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", std::move(upload_done_data));
}
void WebRtcLogUploader::PrepareMultipartPostData(
@@ -159,28 +142,7 @@ void WebRtcLogUploader::PrepareMultipart
DCHECK(!compressed_log.empty());
DCHECK(meta_data.get());
- std::unique_ptr<std::string> post_data(new std::string());
- SetupMultipart(post_data.get(), compressed_log,
- upload_done_data.paths.incoming_rtp_dump,
- upload_done_data.paths.outgoing_rtp_dump, *meta_data.get());
-
- // 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
- // using the test framework for that without hanging.
- // TODO(grunell): Remove this when the api test for this feature is fully
- // implemented according to the test plan. http://crbug.com/257329.
- if (post_data_) {
- *post_data_ = *post_data;
- NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "",
- std::move(upload_done_data));
- return;
- }
-
- main_task_runner_->PostTask(
- FROM_HERE,
- base::BindOnce(&WebRtcLogUploader::UploadCompressedLog,
- base::Unretained(this), std::move(upload_done_data),
- std::move(post_data)));
+ NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", std::move(upload_done_data));
}
void WebRtcLogUploader::UploadStoredLog(
@@ -246,49 +208,6 @@ void WebRtcLogUploader::LoggingStoppedDo
DCHECK(log_buffer.get());
DCHECK(!log_paths.directory.empty());
- webrtc_logging::DeleteOldWebRtcLogFiles(log_paths.directory);
-
- base::FilePath log_list_path =
- webrtc_logging::TextLogList::GetWebRtcLogListFileForDirectory(
- log_paths.directory);
-
- // Store the native log with a ".gz" extension.
- std::string compressed_log = CompressLog(log_buffer.get());
- base::FilePath native_log_path =
- log_paths.directory.AppendASCII(log_id).AddExtension(
- FILE_PATH_LITERAL(".gz"));
- WriteCompressedLogToFile(compressed_log, native_log_path);
- AddLocallyStoredLogInfoToUploadListFile(log_list_path, log_id);
-
- // Move the rtp dump files to the log directory with a name of
- // <log id>.rtp_[in|out].
- if (!log_paths.incoming_rtp_dump.empty()) {
- base::FilePath rtp_path =
- log_paths.directory.AppendASCII(log_id).AddExtension(
- FILE_PATH_LITERAL(".rtp_in"));
- base::Move(log_paths.incoming_rtp_dump, rtp_path);
- }
-
- if (!log_paths.outgoing_rtp_dump.empty()) {
- base::FilePath rtp_path =
- log_paths.directory.AppendASCII(log_id).AddExtension(
- FILE_PATH_LITERAL(".rtp_out"));
- base::Move(log_paths.outgoing_rtp_dump, rtp_path);
- }
-
- if (meta_data.get() && !meta_data->empty()) {
- base::Pickle pickle;
- for (const auto& it : *meta_data.get()) {
- pickle.WriteString(it.first);
- pickle.WriteString(it.second);
- }
- base::FilePath meta_path =
- log_paths.directory.AppendASCII(log_id).AddExtension(
- FILE_PATH_LITERAL(".meta"));
- base::WriteFile(meta_path, static_cast<const char*>(pickle.data()),
- pickle.size());
- }
-
main_task_runner_->PostTask(
FROM_HERE, base::BindOnce(std::move(done_callback), true, ""));
|