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

Unified Diff: handler/crash_report_upload_thread.h

Issue 1295363002: Port CrashReportUploadThread to Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes Created 5 years, 4 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
« no previous file with comments | « no previous file | handler/crash_report_upload_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0372a83a3d4d1f2fae859ffcc52ae71d0f2f3eb6 100644
--- a/handler/mac/crash_report_upload_thread.h
+++ b/handler/crash_report_upload_thread.h
@@ -12,20 +12,23 @@
// 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 {
+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.
@@ -76,6 +79,8 @@ class CrashReportUploadThread {
void ReportPending();
private:
+ friend internal::CrashReportUploadHelperThread;
+
//! \brief The result code from UploadReport().
enum class UploadResult {
//! \brief The crash report was uploaded successfully.
@@ -133,20 +138,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<internal::CrashReportUploadHelperThread> thread_;
bool running_;
};
} // namespace crashpad
-#endif // CRASHPAD_HANDLER_MAC_CRASH_REPORT_UPLOAD_THREAD_H_
+#endif // CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_
« 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