Index: third_party/crashpad/crashpad/util/misc/zlib.cc |
diff --git a/third_party/crashpad/crashpad/util/thread/thread_posix.cc b/third_party/crashpad/crashpad/util/misc/zlib.cc |
similarity index 53% |
copy from third_party/crashpad/crashpad/util/thread/thread_posix.cc |
copy to third_party/crashpad/crashpad/util/misc/zlib.cc |
index 7142c78685c6f2d6d62591a86b558ce04dd158b1..b26f9c90cb918908aadda01a211e8cb8fe8b0938 100644 |
--- a/third_party/crashpad/crashpad/util/thread/thread_posix.cc |
+++ b/third_party/crashpad/crashpad/util/misc/zlib.cc |
@@ -1,4 +1,4 @@ |
-// Copyright 2015 The Crashpad Authors. All rights reserved. |
+// Copyright 2017 The Crashpad Authors. All rights reserved. |
// |
// Licensed under the Apache License, Version 2.0 (the "License"); |
// you may not use this file except in compliance with the License. |
@@ -12,30 +12,26 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#include "util/thread/thread.h" |
+#include "util/misc/zlib.h" |
#include "base/logging.h" |
+#include "base/strings/stringprintf.h" |
+#include "third_party/zlib/zlib_crashpad.h" |
namespace crashpad { |
-void Thread::Start() { |
- DCHECK(!platform_thread_); |
- int rv = pthread_create(&platform_thread_, nullptr, ThreadEntryThunk, this); |
- PCHECK(0 == rv); |
-} |
+int ZlibWindowBitsWithGzipWrapper(int window_bits) { |
+ // See the documentation for deflateInit2() and inflateInit2() in <zlib.h>. 0 |
+ // is only valid during decompression. |
+ |
+ DCHECK(window_bits == 0 || (window_bits >= 8 && window_bits <= 15)) |
+ << window_bits; |
-void Thread::Join() { |
- DCHECK(platform_thread_); |
- int rv = pthread_join(platform_thread_, nullptr); |
- PCHECK(0 == rv); |
- platform_thread_ = 0; |
+ return 16 + window_bits; |
} |
-// static |
-void* Thread::ThreadEntryThunk(void* argument) { |
- Thread* self = reinterpret_cast<Thread*>(argument); |
- self->ThreadMain(); |
- return nullptr; |
+std::string ZlibErrorString(int zr) { |
+ return base::StringPrintf("%s (%d)", zError(zr), zr); |
} |
} // namespace crashpad |