OLD | NEW |
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 27 matching lines...) Expand all Loading... |
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 | 46 //! \param[in] rate_limit Whether uploads should be throttled to a (currently |
47 //! hardcoded) rate. | 47 //! hardcoded) rate. |
| 48 //! \param[in] upload_gzip Whether uploads should use `gzip` compression. |
48 CrashReportUploadThread(CrashReportDatabase* database, | 49 CrashReportUploadThread(CrashReportDatabase* database, |
49 const std::string& url, | 50 const std::string& url, |
50 bool rate_limit); | 51 bool rate_limit, |
| 52 bool upload_gzip); |
51 ~CrashReportUploadThread(); | 53 ~CrashReportUploadThread(); |
52 | 54 |
53 //! \brief Starts a dedicated upload thread, which executes ThreadMain(). | 55 //! \brief Starts a dedicated upload thread, which executes ThreadMain(). |
54 //! | 56 //! |
55 //! This method may only be be called on a newly-constructed object or after | 57 //! This method may only be be called on a newly-constructed object or after |
56 //! a call to Stop(). | 58 //! a call to Stop(). |
57 void Start(); | 59 void Start(); |
58 | 60 |
59 //! \brief Stops the upload thread. | 61 //! \brief Stops the upload thread. |
60 //! | 62 //! |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 134 |
133 // WorkerThread::Delegate: | 135 // WorkerThread::Delegate: |
134 //! \brief Calls ProcessPendingReports() in response to ReportPending() having | 136 //! \brief Calls ProcessPendingReports() in response to ReportPending() having |
135 //! been called on any thread, as well as periodically on a timer. | 137 //! been called on any thread, as well as periodically on a timer. |
136 void DoWork(const WorkerThread* thread) override; | 138 void DoWork(const WorkerThread* thread) override; |
137 | 139 |
138 std::string url_; | 140 std::string url_; |
139 WorkerThread thread_; | 141 WorkerThread thread_; |
140 CrashReportDatabase* database_; // weak | 142 CrashReportDatabase* database_; // weak |
141 bool rate_limit_; | 143 bool rate_limit_; |
| 144 bool upload_gzip_; |
142 | 145 |
143 DISALLOW_COPY_AND_ASSIGN(CrashReportUploadThread); | 146 DISALLOW_COPY_AND_ASSIGN(CrashReportUploadThread); |
144 }; | 147 }; |
145 | 148 |
146 } // namespace crashpad | 149 } // namespace crashpad |
147 | 150 |
148 #endif // CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_ | 151 #endif // CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_ |
OLD | NEW |