Index: chrome/browser/feedback/feedback_util.cc |
diff --git a/chrome/browser/feedback/feedback_util.cc b/chrome/browser/feedback/feedback_util.cc |
index 4b33f648f0bb6b499565a8e3d4f0e652a120077f..dd64c14fabae1a208aa88ec23715dc4d092c3c93 100644 |
--- a/chrome/browser/feedback/feedback_util.cc |
+++ b/chrome/browser/feedback/feedback_util.cc |
@@ -248,22 +248,16 @@ void SendReport(scoped_refptr<FeedbackData> data) { |
bool ZipString(const base::FilePath& filename, |
const std::string& data, std::string* compressed_logs) { |
- base::FilePath temp_path; |
base::FilePath zip_file; |
- // Create a temporary directory, put the logs into a file in it. Create |
- // another temporary file to receive the zip file in. |
- if (!base::CreateNewTempDirectory(base::FilePath::StringType(), &temp_path)) |
- return false; |
- if (file_util::WriteFile(temp_path.Append(filename), |
- data.c_str(), data.size()) == -1) |
- return false; |
+ zip::ZipContents contents_to_zip; |
+ contents_to_zip[filename] = |
+ new base::RefCountedStaticMemory(data.data(), data.size()); |
bool succeed = base::CreateTemporaryFile(&zip_file) && |
- zip::Zip(temp_path, zip_file, false) && |
+ zip::ZipFromMemory(zip_file, contents_to_zip, false) && |
base::ReadFileToString(zip_file, compressed_logs); |
- base::DeleteFile(temp_path, true); |
base::DeleteFile(zip_file, false); |
return succeed; |