| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_TRACING_TRACE_UPLOADER_H_ | 5 #ifndef CONTENT_BROWSER_TRACING_TRACE_UPLOADER_H_ |
| 6 #define CONTENT_BROWSER_TRACING_TRACE_UPLOADER_H_ | 6 #define CONTENT_BROWSER_TRACING_TRACE_UPLOADER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 UploadDoneCallback; | 39 UploadDoneCallback; |
| 40 typedef base::Callback<void(int64, int64)> UploadProgressCallback; | 40 typedef base::Callback<void(int64, int64)> UploadProgressCallback; |
| 41 | 41 |
| 42 TraceUploader(const std::string& product, | 42 TraceUploader(const std::string& product, |
| 43 const std::string& version, | 43 const std::string& version, |
| 44 const std::string& upload_url, | 44 const std::string& upload_url, |
| 45 net::URLRequestContextGetter* request_context); | 45 net::URLRequestContextGetter* request_context); |
| 46 virtual ~TraceUploader(); | 46 virtual ~TraceUploader(); |
| 47 | 47 |
| 48 // net::URLFetcherDelegate implementation. | 48 // net::URLFetcherDelegate implementation. |
| 49 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 49 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 50 virtual void OnURLFetchUploadProgress(const net::URLFetcher* source, | 50 virtual void OnURLFetchUploadProgress(const net::URLFetcher* source, |
| 51 int64 current, int64 total) OVERRIDE; | 51 int64 current, int64 total) override; |
| 52 | 52 |
| 53 // Compresses and uploads the given file contents. | 53 // Compresses and uploads the given file contents. |
| 54 void DoUpload(const std::string& file_contents, | 54 void DoUpload(const std::string& file_contents, |
| 55 UploadProgressCallback progress_callback, | 55 UploadProgressCallback progress_callback, |
| 56 UploadDoneCallback done_callback); | 56 UploadDoneCallback done_callback); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 // Sets up a multipart body to be uploaded. The body is produced according | 59 // Sets up a multipart body to be uploaded. The body is produced according |
| 60 // to RFC 2046. | 60 // to RFC 2046. |
| 61 void SetupMultipart(const std::string& trace_filename, | 61 void SetupMultipart(const std::string& trace_filename, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 82 UploadDoneCallback done_callback_; | 82 UploadDoneCallback done_callback_; |
| 83 | 83 |
| 84 net::URLRequestContextGetter* request_context_; | 84 net::URLRequestContextGetter* request_context_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(TraceUploader); | 86 DISALLOW_COPY_AND_ASSIGN(TraceUploader); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace content | 89 } // namespace content |
| 90 | 90 |
| 91 #endif // CONTENT_BROWSER_TRACING_TRACE_UPLOADER_H_ | 91 #endif // CONTENT_BROWSER_TRACING_TRACE_UPLOADER_H_ |
| OLD | NEW |