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

Unified Diff: third_party/crashpad/crashpad/handler/crash_report_upload_thread.h

Issue 1568553002: Update Crashpad to 54048cfd78af0a54cf4a2d2ecfb83881f5c54590 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: OWN 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 side-by-side diff with in-line comments
Download patch
Index: third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
diff --git a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
index f1bb75b62eee3b9e48150aa167a65f48d062c303..ee5a6fdba252f614861e5dede32d794df965e121 100644
--- a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
+++ b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
@@ -17,16 +17,13 @@
#include <string>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "client/crash_report_database.h"
-#include "util/synchronization/semaphore.h"
+#include "util/thread/worker_thread.h"
namespace crashpad {
-namespace internal {
-class CrashReportUploadHelperThread;
-} // namespace internal
-
//! \brief A thread that processes pending crash reports in a
//! CrashReportDatabase by uploading them or marking them as completed
//! without upload, as desired.
@@ -40,7 +37,7 @@ class CrashReportUploadHelperThread;
//! catches reports that are added without a ReportPending() signal being
//! caught. This may happen if crash reports are added to the database by other
//! processes.
-class CrashReportUploadThread {
+class CrashReportUploadThread : public WorkerThread::Delegate {
public:
//! \brief Constructs a new object.
//!
@@ -77,8 +74,6 @@ class CrashReportUploadThread {
void ReportPending();
private:
- friend internal::CrashReportUploadHelperThread;
-
//! \brief The result code from UploadReport().
enum class UploadResult {
//! \brief The crash report was uploaded successfully.
@@ -99,10 +94,6 @@ class CrashReportUploadThread {
kRetry,
};
- //! \brief Calls ProcessPendingReports() in response to ReportPending() having
- //! been called on any thread, as well as periodically on a timer.
- void ThreadMain();
-
//! \brief Obtains all pending reports from the database, and calls
//! ProcessPendingReport() to process each one.
void ProcessPendingReports();
@@ -136,11 +127,16 @@ class CrashReportUploadThread {
UploadResult UploadReport(const CrashReportDatabase::Report* report,
std::string* response_body);
+ // WorkerThread::Delegate:
+ //! \brief Calls ProcessPendingReports() in response to ReportPending() having
+ //! been called on any thread, as well as periodically on a timer.
+ void DoWork(const WorkerThread* thread) override;
+
std::string url_;
+ WorkerThread thread_;
CrashReportDatabase* database_; // weak
- Semaphore semaphore_; // TODO(mark): Use a condition variable instead?
- scoped_ptr<internal::CrashReportUploadHelperThread> thread_;
- bool running_;
+
+ DISALLOW_COPY_AND_ASSIGN(CrashReportUploadThread);
};
} // namespace crashpad
« no previous file with comments | « third_party/crashpad/crashpad/crashpad.gyp ('k') | third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698