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

Unified Diff: chrome/browser/media/webrtc_log_uploader.h

Issue 17589014: Write a log list for uploaded WebRTC logs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some unit test changes. Created 7 years, 6 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: chrome/browser/media/webrtc_log_uploader.h
diff --git a/chrome/browser/media/webrtc_log_uploader.h b/chrome/browser/media/webrtc_log_uploader.h
index 60225c60db7af29a6877dab53e4f4cac18cfd68f..a9620c35d761e883a353c31b20aa95e6ffbe8425 100644
--- a/chrome/browser/media/webrtc_log_uploader.h
+++ b/chrome/browser/media/webrtc_log_uploader.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/platform_file.h"
#include "net/url_request/url_fetcher_delegate.h"
@@ -27,11 +28,14 @@ typedef struct z_stream_s z_stream;
class WebRtcLogURLRequestContextGetter;
// WebRtcLogUploader uploads WebRTC logs, keeps count of how many logs have
-// been started and denies further logs if a limit is reached. There must only
-// be one object of this type.
+// been started and denies further logs if a limit is reached. It also adds
+// the timestamp and report ID of the uploded log to a text file. There must
+// only be one object of this type.
class WebRtcLogUploader : public net::URLFetcherDelegate {
public:
- WebRtcLogUploader();
+ // |upload_list_path| is the text file to add the uploaded log info to. It is
+ // intended for testing. If empty the default path will be used.
+ explicit WebRtcLogUploader(base::FilePath& upload_list_path);
tommi (sloooow) - chröme 2013/07/01 12:01:01 instead of changing the constructor and add a File
Henrik Grunell 2013/07/01 13:26:22 Done.
virtual ~WebRtcLogUploader();
// net::URLFetcherDelegate implementation.
@@ -54,6 +58,8 @@ class WebRtcLogUploader : public net::URLFetcherDelegate {
const std::string& app_url);
private:
+ FRIEND_TEST_ALL_PREFIXES(WebRtcLogUploaderTest, Basic);
+
// Sets up a multipart body to be uploaded. The body is produced according
// to RFC 2046.
void SetupMultipart(std::string* post_data, uint8* log_buffer,
@@ -67,7 +73,18 @@ class WebRtcLogUploader : public net::URLFetcherDelegate {
void ResizeForNextOutput(std::string* post_data, z_stream* stream);
void DecreaseLogCount();
+ // Append information (time and report ID) about this uploaded log to a log
+ // list file, limited to |kLogListLimitLines| entries. This list is used for
+ // viewing the uploaded logs under chrome://webrtc-logs, see
+ // WebRtcLogUploadList. The list has the format
+ // time,id
+ // time,id
+ // etc.
+ // where each line represents an uploaded log and "time" is Unix time.
+ void AddUploadedLogInfoToUploadListFile(const std::string& report_id);
+
int log_count_;
+ base::FilePath upload_list_path_;
DISALLOW_COPY_AND_ASSIGN(WebRtcLogUploader);
};

Powered by Google App Engine
This is Rietveld 408576698