Index: third_party/crashpad/crashpad/test/hex_string.cc |
diff --git a/third_party/crashpad/crashpad/util/net/http_headers.h b/third_party/crashpad/crashpad/test/hex_string.cc |
similarity index 54% |
copy from third_party/crashpad/crashpad/util/net/http_headers.h |
copy to third_party/crashpad/crashpad/test/hex_string.cc |
index 3633cb2d690654d1c802edf6a2cede979eb0641e..bb9b5f3a89eae727a5a9df9f616a2adbebc78f6b 100644 |
--- a/third_party/crashpad/crashpad/util/net/http_headers.h |
+++ b/third_party/crashpad/crashpad/test/hex_string.cc |
@@ -1,4 +1,4 @@ |
-// Copyright 2014 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,23 +12,24 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#ifndef CRASHPAD_UTIL_NET_HTTP_HEADERS_H_ |
-#define CRASHPAD_UTIL_NET_HTTP_HEADERS_H_ |
+#include "test/hex_string.h" |
-#include <map> |
-#include <string> |
+#include "base/strings/stringprintf.h" |
namespace crashpad { |
+namespace test { |
-//! \brief A map of HTTP header fields to their values. |
-using HTTPHeaders = std::map<std::string, std::string>; |
+std::string BytesToHexString(const void* bytes, size_t length) { |
+ const unsigned char* bytes_c = reinterpret_cast<const unsigned char*>(bytes); |
-//! \brief The header name `"Content-Type"`. |
-extern const char kContentType[]; |
+ std::string hex_string; |
+ hex_string.reserve(length * 2); |
+ for (size_t index = 0; index < length; ++index) { |
+ hex_string.append(base::StringPrintf("%02x", bytes_c[index])); |
+ } |
-//! \brief The header name `"Content-Length"`. |
-extern const char kContentLength[]; |
+ return hex_string; |
+} |
+} // namespace test |
} // namespace crashpad |
- |
-#endif // CRASHPAD_UTIL_NET_HTTP_HEADERS_H_ |