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 2a33417165a467e6f4effa312ec33be0468cb5a5..0d0fdde9b9bc20275f4b3a6059ac4ed24ae67d26 100644 |
--- a/chrome/browser/media/webrtc_log_uploader.h |
+++ b/chrome/browser/media/webrtc_log_uploader.h |
@@ -10,8 +10,6 @@ |
#include "base/basictypes.h" |
#include "base/gtest_prod_util.h" |
-#include "base/memory/ref_counted.h" |
-#include "base/platform_file.h" |
#include "base/threading/thread_checker.h" |
#include "chrome/browser/media/webrtc_logging_handler_host.h" |
#include "net/url_request/url_fetcher_delegate.h" |
@@ -24,7 +22,6 @@ class SharedMemory; |
namespace net { |
class URLFetcher; |
-class URLRequestContextGetter; |
} |
typedef struct z_stream_s z_stream; |
@@ -36,8 +33,6 @@ typedef struct { |
scoped_refptr<WebRtcLoggingHandlerHost> host; |
} WebRtcLogUploadDoneData; |
-class WebRtcLogURLRequestContextGetter; |
- |
// WebRtcLogUploader uploads WebRTC logs, keeps count of how many logs have |
// 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 |
@@ -69,12 +64,15 @@ class WebRtcLogUploader : public net::URLFetcherDelegate { |
// 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<unsigned char[]> log_buffer, |
uint32 length, |
const std::map<std::string, std::string>& meta_data, |
const WebRtcLogUploadDoneData& upload_done_data); |
+ // Cancels URL fetcher operation by resetting |url_fetcher_|. This cancels any |
+ // pending uploads and releases SystemURLRequestContextGetter references. |
+ void CancelURLFetcherOperations(); |
+ |
// For testing purposes. If called, the multipart will not be uploaded, but |
// written to |post_data_| instead. |
void OverrideUploadWithBufferForTesting(std::string* post_data) { |
@@ -97,7 +95,6 @@ class WebRtcLogUploader : public net::URLFetcherDelegate { |
void ResizeForNextOutput(std::string* post_data, z_stream* stream); |
void CreateAndStartURLFetcher( |
- scoped_refptr<net::URLRequestContextGetter> request_context, |
const WebRtcLogUploadDoneData& upload_done_data, |
scoped_ptr<std::string> post_data); |
@@ -125,8 +122,14 @@ class WebRtcLogUploader : public net::URLFetcherDelegate { |
// This is the FILE thread for Chromium. Some other thread for tests. |
base::ThreadChecker file_thread_checker_; |
+ // Keeps track of number of currently open logs. Must be accessed on the UI |
+ // thread. |
int log_count_; |
+ // The URLFetchers used for uploading. Must be accessed on the UI thread. |
+ typedef std::vector<scoped_ptr<net::URLFetcher> > URLFetcherVector; |
+ URLFetcherVector url_fetchers_; |
+ |
// For testing purposes, see OverrideUploadWithBufferForTesting. Only accessed |
// on the FILE thread. |
std::string* post_data_; |