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

Side by Side Diff: trunk/src/chrome/browser/media/webrtc_log_uploader.h

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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_LOG_UPLOADER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_LOG_UPLOADER_H_
6 #define CHROME_BROWSER_MEDIA_WEBRTC_LOG_UPLOADER_H_ 6 #define CHROME_BROWSER_MEDIA_WEBRTC_LOG_UPLOADER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 16 matching lines...) Expand all
27 27
28 typedef struct z_stream_s z_stream; 28 typedef struct z_stream_s z_stream;
29 29
30 // Used when uploading is done to perform post-upload actions. |log_path| is 30 // Used when uploading is done to perform post-upload actions. |log_path| is
31 // also used pre-upload. 31 // also used pre-upload.
32 struct WebRtcLogUploadDoneData { 32 struct WebRtcLogUploadDoneData {
33 WebRtcLogUploadDoneData(); 33 WebRtcLogUploadDoneData();
34 ~WebRtcLogUploadDoneData(); 34 ~WebRtcLogUploadDoneData();
35 35
36 base::FilePath log_path; 36 base::FilePath log_path;
37 base::FilePath incoming_rtp_dump;
38 base::FilePath outgoing_rtp_dump;
39 WebRtcLoggingHandlerHost::UploadDoneCallback callback; 37 WebRtcLoggingHandlerHost::UploadDoneCallback callback;
40 scoped_refptr<WebRtcLoggingHandlerHost> host; 38 scoped_refptr<WebRtcLoggingHandlerHost> host;
41 std::string local_log_id; 39 std::string local_log_id;
42 }; 40 };
43 41
44 // WebRtcLogUploader uploads WebRTC logs, keeps count of how many logs have 42 // WebRtcLogUploader uploads WebRTC logs, keeps count of how many logs have
45 // been started and denies further logs if a limit is reached. It also adds 43 // been started and denies further logs if a limit is reached. It also adds
46 // the timestamp and report ID of the uploded log to a text file. There must 44 // the timestamp and report ID of the uploded log to a text file. There must
47 // only be one object of this type. 45 // only be one object of this type.
48 class WebRtcLogUploader : public net::URLFetcherDelegate { 46 class WebRtcLogUploader : public net::URLFetcherDelegate {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 private: 92 private:
95 FRIEND_TEST_ALL_PREFIXES(WebRtcLogUploaderTest, 93 FRIEND_TEST_ALL_PREFIXES(WebRtcLogUploaderTest,
96 AddLocallyStoredLogInfoToUploadListFile); 94 AddLocallyStoredLogInfoToUploadListFile);
97 FRIEND_TEST_ALL_PREFIXES(WebRtcLogUploaderTest, 95 FRIEND_TEST_ALL_PREFIXES(WebRtcLogUploaderTest,
98 AddUploadedLogInfoToUploadListFile); 96 AddUploadedLogInfoToUploadListFile);
99 97
100 // Sets up a multipart body to be uploaded. The body is produced according 98 // Sets up a multipart body to be uploaded. The body is produced according
101 // to RFC 2046. 99 // to RFC 2046.
102 void SetupMultipart(std::string* post_data, 100 void SetupMultipart(std::string* post_data,
103 const std::vector<uint8>& compressed_log, 101 const std::vector<uint8>& compressed_log,
104 const base::FilePath& incoming_rtp_dump,
105 const base::FilePath& outgoing_rtp_dump,
106 const std::map<std::string, std::string>& meta_data); 102 const std::map<std::string, std::string>& meta_data);
107 103
104 // Adds |compressed_log| to |post_data|.
105 void AddLogData(std::string* post_data,
106 const std::vector<uint8>& compressed_log);
107
108 void CompressLog(std::vector<uint8>* compressed_log, 108 void CompressLog(std::vector<uint8>* compressed_log,
109 uint8* input, 109 uint8* input,
110 uint32 input_size); 110 uint32 input_size);
111 111
112 void ResizeForNextOutput(std::vector<uint8>* compressed_log, 112 void ResizeForNextOutput(std::vector<uint8>* compressed_log,
113 z_stream* stream); 113 z_stream* stream);
114 114
115 void CreateAndStartURLFetcher( 115 void CreateAndStartURLFetcher(
116 const WebRtcLogUploadDoneData& upload_done_data, 116 const WebRtcLogUploadDoneData& upload_done_data,
117 scoped_ptr<std::string> post_data); 117 scoped_ptr<std::string> post_data);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // Only accessed on the UI thread. 169 // Only accessed on the UI thread.
170 UploadDoneDataMap upload_done_data_; 170 UploadDoneDataMap upload_done_data_;
171 171
172 // When shutting down, don't create new URLFetchers. 172 // When shutting down, don't create new URLFetchers.
173 bool shutting_down_; 173 bool shutting_down_;
174 174
175 DISALLOW_COPY_AND_ASSIGN(WebRtcLogUploader); 175 DISALLOW_COPY_AND_ASSIGN(WebRtcLogUploader);
176 }; 176 };
177 177
178 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOG_UPLOADER_H_ 178 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOG_UPLOADER_H_
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/media/rtp_dump_type.h ('k') | trunk/src/chrome/browser/media/webrtc_log_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698