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

Unified Diff: trunk/src/chrome/browser/feedback/feedback_util.cc

Issue 89753004: Revert 237280 "Remove TraceController" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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
Index: trunk/src/chrome/browser/feedback/feedback_util.cc
===================================================================
--- trunk/src/chrome/browser/feedback/feedback_util.cc (revision 237451)
+++ trunk/src/chrome/browser/feedback/feedback_util.cc (working copy)
@@ -374,33 +374,24 @@
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 a temporary directory, put the logs into a file in it. Create
+ // another temporary file to receive the zip file in.
if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL(""), &temp_path))
return false;
-
- base::FilePath temp_file = temp_path.Append(filename);
- if (file_util::WriteFile(temp_file, data.c_str(), data.size()) == -1)
+ if (file_util::WriteFile(temp_path.Append(filename),
+ data.c_str(), data.size()) == -1)
return false;
-
- return ZipFile(temp_file, compressed_logs);
-}
-
-bool ZipFile(const base::FilePath& filename, std::string* compressed_logs) {
- base::FilePath zip_file;
-
- // Create a temporary file to receive the zip file in it.
if (!file_util::CreateTemporaryFile(&zip_file))
return false;
- if (!zip::Zip(filename, zip_file, false))
+ if (!zip::Zip(temp_path, zip_file, false))
return false;
if (!base::ReadFileToString(zip_file, compressed_logs))
return false;
- base::DeleteFile(zip_file, false);
-
return true;
}
« no previous file with comments | « trunk/src/chrome/browser/feedback/feedback_util.h ('k') | trunk/src/chrome/browser/feedback/tracing_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698