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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 const CrashReportDatabase::Report* report_; // weak | 132 const CrashReportDatabase::Report* report_; // weak |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(CallRecordUploadAttempt); | 134 DISALLOW_COPY_AND_ASSIGN(CallRecordUploadAttempt); |
135 }; | 135 }; |
136 | 136 |
137 } // namespace | 137 } // namespace |
138 | 138 |
139 CrashReportUploadThread::CrashReportUploadThread(CrashReportDatabase* database, | 139 CrashReportUploadThread::CrashReportUploadThread(CrashReportDatabase* database, |
140 const std::string& url) | 140 const std::string& url) |
141 : url_(url), | 141 : url_(url), |
142 database_(database), | |
143 // Check for pending reports every 15 minutes, even in the absence of a | 142 // Check for pending reports every 15 minutes, even in the absence of a |
144 // signal from the handler thread. This allows for failed uploads to be | 143 // signal from the handler thread. This allows for failed uploads to be |
145 // retried periodically, and for pending reports written by other | 144 // retried periodically, and for pending reports written by other |
146 // processes to be recognized. | 145 // processes to be recognized. |
147 thread_(15 * 60, this) { | 146 thread_(15 * 60, this), |
| 147 database_(database) { |
148 } | 148 } |
149 | 149 |
150 CrashReportUploadThread::~CrashReportUploadThread() { | 150 CrashReportUploadThread::~CrashReportUploadThread() { |
151 } | 151 } |
152 | 152 |
153 void CrashReportUploadThread::Start() { | 153 void CrashReportUploadThread::Start() { |
154 thread_.Start(0); | 154 thread_.Start(0); |
155 } | 155 } |
156 | 156 |
157 void CrashReportUploadThread::Stop() { | 157 void CrashReportUploadThread::Stop() { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 } | 326 } |
327 | 327 |
328 return UploadResult::kSuccess; | 328 return UploadResult::kSuccess; |
329 } | 329 } |
330 | 330 |
331 void CrashReportUploadThread::DoWork(const WorkerThread* thread) { | 331 void CrashReportUploadThread::DoWork(const WorkerThread* thread) { |
332 ProcessPendingReports(); | 332 ProcessPendingReports(); |
333 } | 333 } |
334 | 334 |
335 } // namespace crashpad | 335 } // namespace crashpad |
OLD | NEW |