| OLD | NEW |
| 1 // Copyright 2017 The Crashpad Authors. All rights reserved. | 1 // Copyright 2017 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 FileWriter* file_writer_impl = new FileWriter(); | 156 FileWriter* file_writer_impl = new FileWriter(); |
| 157 file_writer.reset(file_writer_impl); | 157 file_writer.reset(file_writer_impl); |
| 158 base::FilePath output_path( | 158 base::FilePath output_path( |
| 159 ToolSupport::CommandLineArgumentToFilePathStringType(options.output)); | 159 ToolSupport::CommandLineArgumentToFilePathStringType(options.output)); |
| 160 if (!file_writer_impl->Open(output_path, | 160 if (!file_writer_impl->Open(output_path, |
| 161 FileWriteMode::kTruncateOrCreate, | 161 FileWriteMode::kTruncateOrCreate, |
| 162 FilePermissions::kWorldReadable)) { | 162 FilePermissions::kWorldReadable)) { |
| 163 return EXIT_FAILURE; | 163 return EXIT_FAILURE; |
| 164 } | 164 } |
| 165 } else { | 165 } else { |
| 166 file_writer.reset(new WeakStdioFileWriter(stdout)); | 166 file_writer.reset(new WeakFileHandleFileWriter( |
| 167 StdioFileHandle(StdioStream::kStandardOutput))); |
| 167 } | 168 } |
| 168 | 169 |
| 169 http_multipart_builder.SetGzipEnabled(options.upload_gzip); | 170 http_multipart_builder.SetGzipEnabled(options.upload_gzip); |
| 170 | 171 |
| 171 std::unique_ptr<HTTPTransport> http_transport(HTTPTransport::Create()); | 172 std::unique_ptr<HTTPTransport> http_transport(HTTPTransport::Create()); |
| 172 http_transport->SetURL(options.url); | 173 http_transport->SetURL(options.url); |
| 173 | 174 |
| 174 HTTPHeaders content_headers; | 175 HTTPHeaders content_headers; |
| 175 http_multipart_builder.PopulateContentHeaders(&content_headers); | 176 http_multipart_builder.PopulateContentHeaders(&content_headers); |
| 176 for (const auto& content_header : content_headers) { | 177 for (const auto& content_header : content_headers) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 197 | 198 |
| 198 #if defined(OS_POSIX) | 199 #if defined(OS_POSIX) |
| 199 int main(int argc, char* argv[]) { | 200 int main(int argc, char* argv[]) { |
| 200 return crashpad::HTTPUploadMain(argc, argv); | 201 return crashpad::HTTPUploadMain(argc, argv); |
| 201 } | 202 } |
| 202 #elif defined(OS_WIN) | 203 #elif defined(OS_WIN) |
| 203 int wmain(int argc, wchar_t* argv[]) { | 204 int wmain(int argc, wchar_t* argv[]) { |
| 204 return crashpad::ToolSupport::Wmain(argc, argv, crashpad::HTTPUploadMain); | 205 return crashpad::ToolSupport::Wmain(argc, argv, crashpad::HTTPUploadMain); |
| 205 } | 206 } |
| 206 #endif // OS_POSIX | 207 #endif // OS_POSIX |
| OLD | NEW |