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

Side by Side Diff: handler/crash_report_upload_thread.h

Issue 1563683002: Allow disabling upload rate-limiting (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: rebase Created 4 years, 11 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
« no previous file with comments | « no previous file | handler/crash_report_upload_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 25 matching lines...) Expand all
36 //! upload attempts for reports left in the pending state to be retried. It also 36 //! upload attempts for reports left in the pending state to be retried. It also
37 //! catches reports that are added without a ReportPending() signal being 37 //! catches reports that are added without a ReportPending() signal being
38 //! caught. This may happen if crash reports are added to the database by other 38 //! caught. This may happen if crash reports are added to the database by other
39 //! processes. 39 //! processes.
40 class CrashReportUploadThread : public WorkerThread::Delegate { 40 class CrashReportUploadThread : public WorkerThread::Delegate {
41 public: 41 public:
42 //! \brief Constructs a new object. 42 //! \brief Constructs a new object.
43 //! 43 //!
44 //! \param[in] database The database to upload crash reports from. 44 //! \param[in] database The database to upload crash reports from.
45 //! \param[in] url The URL of the server to upload crash reports to. 45 //! \param[in] url The URL of the server to upload crash reports to.
46 //! \param[in] rate_limit Whether uploads should be throttled to a (currently
47 //! hardcoded) rate.
46 CrashReportUploadThread(CrashReportDatabase* database, 48 CrashReportUploadThread(CrashReportDatabase* database,
47 const std::string& url); 49 const std::string& url,
50 bool rate_limit);
48 ~CrashReportUploadThread(); 51 ~CrashReportUploadThread();
49 52
50 //! \brief Starts a dedicated upload thread, which executes ThreadMain(). 53 //! \brief Starts a dedicated upload thread, which executes ThreadMain().
51 //! 54 //!
52 //! This method may only be be called on a newly-constructed object or after 55 //! This method may only be be called on a newly-constructed object or after
53 //! a call to Stop(). 56 //! a call to Stop().
54 void Start(); 57 void Start();
55 58
56 //! \brief Stops the upload thread. 59 //! \brief Stops the upload thread.
57 //! 60 //!
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 std::string* response_body); 131 std::string* response_body);
129 132
130 // WorkerThread::Delegate: 133 // WorkerThread::Delegate:
131 //! \brief Calls ProcessPendingReports() in response to ReportPending() having 134 //! \brief Calls ProcessPendingReports() in response to ReportPending() having
132 //! been called on any thread, as well as periodically on a timer. 135 //! been called on any thread, as well as periodically on a timer.
133 void DoWork(const WorkerThread* thread) override; 136 void DoWork(const WorkerThread* thread) override;
134 137
135 std::string url_; 138 std::string url_;
136 WorkerThread thread_; 139 WorkerThread thread_;
137 CrashReportDatabase* database_; // weak 140 CrashReportDatabase* database_; // weak
141 bool rate_limit_;
138 142
139 DISALLOW_COPY_AND_ASSIGN(CrashReportUploadThread); 143 DISALLOW_COPY_AND_ASSIGN(CrashReportUploadThread);
140 }; 144 };
141 145
142 } // namespace crashpad 146 } // namespace crashpad
143 147
144 #endif // CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_ 148 #endif // CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_
OLDNEW
« no previous file with comments | « no previous file | handler/crash_report_upload_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698