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

Side by Side Diff: chrome/browser/tracing/crash_service_uploader.h

Issue 2085623005: Limit the background trials upload size to 100Kib when using mobile data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Configure size limit. Created 4 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
OLDNEW
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 CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ 5 #ifndef CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_
6 #define CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ 6 #define CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 15 matching lines...) Expand all
26 // TraceCrashServiceUploader uploads traces to the Chrome crash service. 26 // TraceCrashServiceUploader uploads traces to the Chrome crash service.
27 class TraceCrashServiceUploader : public content::TraceUploader, 27 class TraceCrashServiceUploader : public content::TraceUploader,
28 public net::URLFetcherDelegate { 28 public net::URLFetcherDelegate {
29 public: 29 public:
30 explicit TraceCrashServiceUploader( 30 explicit TraceCrashServiceUploader(
31 net::URLRequestContextGetter* request_context); 31 net::URLRequestContextGetter* request_context);
32 ~TraceCrashServiceUploader() override; 32 ~TraceCrashServiceUploader() override;
33 33
34 void SetUploadURL(const std::string& url); 34 void SetUploadURL(const std::string& url);
35 35
36 void SetMaxUploadBytes(size_t max_upload_bytes);
37
36 // net::URLFetcherDelegate implementation. 38 // net::URLFetcherDelegate implementation.
37 void OnURLFetchComplete(const net::URLFetcher* source) override; 39 void OnURLFetchComplete(const net::URLFetcher* source) override;
38 void OnURLFetchUploadProgress(const net::URLFetcher* source, 40 void OnURLFetchUploadProgress(const net::URLFetcher* source,
39 int64_t current, 41 int64_t current,
40 int64_t total) override; 42 int64_t total) override;
41 43
42 // content::TraceUploader 44 // content::TraceUploader
43 void DoUpload(const std::string& file_contents, 45 void DoUpload(const std::string& file_contents,
44 UploadMode upload_mode, 46 UploadMode upload_mode,
45 std::unique_ptr<const base::DictionaryValue> metadata, 47 std::unique_ptr<const base::DictionaryValue> metadata,
(...skipping 29 matching lines...) Expand all
75 void OnUploadError(const std::string& error_message); 77 void OnUploadError(const std::string& error_message);
76 78
77 std::unique_ptr<net::URLFetcher> url_fetcher_; 79 std::unique_ptr<net::URLFetcher> url_fetcher_;
78 UploadProgressCallback progress_callback_; 80 UploadProgressCallback progress_callback_;
79 UploadDoneCallback done_callback_; 81 UploadDoneCallback done_callback_;
80 82
81 net::URLRequestContextGetter* request_context_; 83 net::URLRequestContextGetter* request_context_;
82 84
83 std::string upload_url_; 85 std::string upload_url_;
84 86
87 size_t max_upload_bytes_;
88
85 DISALLOW_COPY_AND_ASSIGN(TraceCrashServiceUploader); 89 DISALLOW_COPY_AND_ASSIGN(TraceCrashServiceUploader);
86 }; 90 };
87 91
88 #endif // CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ 92 #endif // CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_
OLDNEW
« no previous file with comments | « chrome/browser/tracing/background_tracing_field_trial.cc ('k') | chrome/browser/tracing/crash_service_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698