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

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

Issue 23691066: Hook up WebRTC logging extension API to the underlying functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: First patch ready for review. Created 7 years, 3 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 ecd53d645198066b3fa3e0e0b89de35ebd189622..dcd48522f862f20361d686f4bdc8208f0958a371 100644
--- a/chrome/browser/media/webrtc_log_uploader.h
+++ b/chrome/browser/media/webrtc_log_uploader.h
@@ -6,12 +6,12 @@
#define CHROME_BROWSER_MEDIA_WEBRTC_LOG_UPLOADER_H_
#include <string>
no longer working on chromium 2013/10/01 08:41:42 include what you are using: include <map>
Henrik Grunell 2013/10/02 12:47:18 Done.
-#include <vector>
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/platform_file.h"
+#include "chrome/browser/media/webrtc_logging_handler_host.h"
#include "net/url_request/url_fetcher_delegate.h"
namespace base {
@@ -25,6 +25,12 @@ class URLRequestContextGetter;
typedef struct z_stream_s z_stream;
+// Used when uploading is done to inform about that it's done.
+typedef struct {
+ WebRtcLoggingHandlerHost::UploadDoneCallback callback;
+ scoped_refptr<WebRtcLoggingHandlerHost> host;
+} WebRtcLogUploadDoneData;
+
class WebRtcLogURLRequestContextGetter;
// WebRtcLogUploader uploads WebRTC logs, keeps count of how many logs have
@@ -45,15 +51,25 @@ class WebRtcLogUploader : public net::URLFetcherDelegate {
// count if true is returned. Must be called before UploadLog().
bool ApplyForStartLogging();
- // Uploads log and decreases log count. May only be called if permission to
+ // Notifies that that logging has stopped and that the log should not be
+ // uploaded. Decreases log count. May only be called if permission to
Jói 2013/09/27 14:39:53 "to to" (one at the end of this line, one at start
Henrik Grunell 2013/10/02 12:47:18 Done.
+ // to log has been granted by calling ApplyForStartLogging() and getting true
+ // in return. After this function has been called, a new permission must be
+ // granted. Call either this function or LoggingStoppedDoUpload().
+ void LoggingStoppedDontUpload();
+
+ // Notifies that that logging has stopped and that the log should be uploaded.
+ // Decreases log count. May only be called if permission to
Jói 2013/09/27 14:39:53 "to to"
Henrik Grunell 2013/10/02 12:47:18 Done.
// to log has been granted by calling ApplyForStartLogging() and getting true
- // in return. After UploadLog has been called, a new permission must be
- // granted.
- void UploadLog(net::URLRequestContextGetter* request_context,
- scoped_ptr<base::SharedMemory> shared_memory,
- uint32 length,
- const std::string& app_session_id,
- const std::string& app_url);
+ // in return. After this function has been called, a new permission must be
+ // granted. Call either this function or LoggingStoppedDontUpload().
+ void LoggingStoppedDoUpload(
+ net::URLRequestContextGetter* request_context,
+ scoped_ptr<base::SharedMemory> shared_memory,
+ uint32 length,
+ const std::map<std::string, std::string>& meta_data,
+ const std::string& app_url,
+ const WebRtcLogUploadDoneData& upload_done_data);
// For testing purposes. If called, the multipart will not be uploaded, but
// written to |post_data_| instead.
@@ -69,7 +85,7 @@ class WebRtcLogUploader : public net::URLFetcherDelegate {
// to RFC 2046.
void SetupMultipart(std::string* post_data, uint8* log_buffer,
uint32 log_buffer_length,
- const std::string& app_session_id,
+ const std::map<std::string, std::string>& meta_data,
const std::string& app_url);
void AddLogData(std::string* post_data, uint8* log_buffer,
@@ -99,6 +115,10 @@ class WebRtcLogUploader : public net::URLFetcherDelegate {
// on the FILE thread.
std::string* post_data_;
+ typedef std::map<const net::URLFetcher*, WebRtcLogUploadDoneData>
+ UploadDoneDataMap;
+ UploadDoneDataMap upload_done_data_;
+
DISALLOW_COPY_AND_ASSIGN(WebRtcLogUploader);
};

Powered by Google App Engine
This is Rietveld 408576698