Chromium Code Reviews| Index: handler/crash_report_upload_thread.h |
| diff --git a/handler/mac/crash_report_upload_thread.h b/handler/crash_report_upload_thread.h |
| similarity index 93% |
| rename from handler/mac/crash_report_upload_thread.h |
| rename to handler/crash_report_upload_thread.h |
| index 6c9be5bf8c36a63af337205fa2582cd548d5224b..1dc94db85d024cf5bf8ede43d95e74eeb5a04067 100644 |
| --- a/handler/mac/crash_report_upload_thread.h |
| +++ b/handler/crash_report_upload_thread.h |
| @@ -12,20 +12,21 @@ |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| -#ifndef CRASHPAD_HANDLER_MAC_CRASH_REPORT_UPLOAD_THREAD_H_ |
| -#define CRASHPAD_HANDLER_MAC_CRASH_REPORT_UPLOAD_THREAD_H_ |
| +#ifndef CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_ |
| +#define CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_ |
| #include "base/basictypes.h" |
| -#include <pthread.h> |
| - |
| #include <string> |
| +#include "base/memory/scoped_ptr.h" |
| #include "client/crash_report_database.h" |
| #include "util/synchronization/semaphore.h" |
| namespace crashpad { |
| +class HelperThread; |
|
Mark Mentovai
2015/08/18 21:38:12
Since this is just in namespace crashpad, you shou
scottmg
2015/08/18 22:21:40
Done.
|
| + |
| //! \brief A thread that processes pending crash reports in a |
| //! CrashReportDatabase by uploading them or marking them as completed |
| //! without upload, as desired. |
| @@ -76,6 +77,8 @@ class CrashReportUploadThread { |
| void ReportPending(); |
| private: |
| + friend class HelperThread; |
| + |
| //! \brief The result code from UploadReport(). |
| enum class UploadResult { |
| //! \brief The crash report was uploaded successfully. |
| @@ -133,20 +136,13 @@ class CrashReportUploadThread { |
| UploadResult UploadReport(const CrashReportDatabase::Report* report, |
| std::string* response_body); |
| - //! \brief Cals ThreadMain(). |
| - //! |
| - //! \param[in] arg A pointer to the object on which to invoke ThreadMain(). |
| - //! |
| - //! \return `nullptr`. |
| - static void* RunThreadMain(void* arg); |
| - |
| std::string url_; |
| CrashReportDatabase* database_; // weak |
| Semaphore semaphore_; // TODO(mark): Use a condition variable instead? |
| - pthread_t thread_; |
| + scoped_ptr<HelperThread> thread_; |
| bool running_; |
| }; |
| } // namespace crashpad |
| -#endif // CRASHPAD_HANDLER_MAC_CRASH_REPORT_UPLOAD_THREAD_H_ |
| +#endif // CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_ |