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 COMPONENTS_METRICS_NET_NET_METRICS_LOG_UPLOADER_H_ | 5 #ifndef COMPONENTS_METRICS_NET_NET_METRICS_LOG_UPLOADER_H_ |
6 #define COMPONENTS_METRICS_NET_NET_METRICS_LOG_UPLOADER_H_ | 6 #define COMPONENTS_METRICS_NET_NET_METRICS_LOG_UPLOADER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // must ensure that |request_context_getter| remains valid for the lifetime | 27 // must ensure that |request_context_getter| remains valid for the lifetime |
28 // of this class. | 28 // of this class. |
29 NetMetricsLogUploader(net::URLRequestContextGetter* request_context_getter, | 29 NetMetricsLogUploader(net::URLRequestContextGetter* request_context_getter, |
30 const std::string& server_url, | 30 const std::string& server_url, |
31 const std::string& mime_type, | 31 const std::string& mime_type, |
32 const base::Callback<void(int)>& on_upload_complete); | 32 const base::Callback<void(int)>& on_upload_complete); |
33 virtual ~NetMetricsLogUploader(); | 33 virtual ~NetMetricsLogUploader(); |
34 | 34 |
35 // MetricsLogUploader: | 35 // MetricsLogUploader: |
36 virtual bool UploadLog(const std::string& compressed_log_data, | 36 virtual bool UploadLog(const std::string& compressed_log_data, |
37 const std::string& log_hash) OVERRIDE; | 37 const std::string& log_hash) override; |
38 | 38 |
39 private: | 39 private: |
40 // net::URLFetcherDelegate: | 40 // net::URLFetcherDelegate: |
41 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 41 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
42 | 42 |
43 // The request context for fetches done using the network stack. | 43 // The request context for fetches done using the network stack. |
44 net::URLRequestContextGetter* const request_context_getter_; | 44 net::URLRequestContextGetter* const request_context_getter_; |
45 | 45 |
46 // The outstanding transmission appears as a URL Fetch operation. | 46 // The outstanding transmission appears as a URL Fetch operation. |
47 scoped_ptr<net::URLFetcher> current_fetch_; | 47 scoped_ptr<net::URLFetcher> current_fetch_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(NetMetricsLogUploader); | 49 DISALLOW_COPY_AND_ASSIGN(NetMetricsLogUploader); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace metrics | 52 } // namespace metrics |
53 | 53 |
54 #endif // COMPONENTS_METRICS_NET_NET_METRICS_LOG_UPLOADER_H_ | 54 #endif // COMPONENTS_METRICS_NET_NET_METRICS_LOG_UPLOADER_H_ |
OLD | NEW |