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

Unified Diff: chrome/browser/chromeos/system_logs/debug_log_writer.h

Issue 329853010: Additional methods for chrome.logPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 5 months 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/system_logs/debug_log_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/system_logs/debug_log_writer.h
diff --git a/chrome/browser/chromeos/system_logs/debug_log_writer.h b/chrome/browser/chromeos/system_logs/debug_log_writer.h
new file mode 100644
index 0000000000000000000000000000000000000000..31a3ed1accbeba09c78842639aad26c37e841f61
--- /dev/null
+++ b/chrome/browser/chromeos/system_logs/debug_log_writer.h
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_DEBUG_LOG_WRITER_H_
+#define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_DEBUG_LOG_WRITER_H_
+
+#include "base/basictypes.h"
+#include "base/callback_forward.h"
+#include "base/files/file_path.h"
+
+namespace chromeos {
+
+class DebugLogWriter {
+ public:
+ // Called once StoreDebugLogs is complete. Takes two parameters:
+ // - log_path: where the log file was saved in the case of success;
+ // - succeeded: was the log file saved successfully.
+ typedef base::Callback<void(const base::FilePath& log_path, bool succeeded)>
+ StoreLogsCallback;
+
+ // Stores debug logs in either .tgz or .tar archive (depending on value of
+ // |should_compress|) on the |fileshelf|. The file is created on the
+ // worker pool, then writing to it is triggered from the UI thread, and
+ // finally it is closed (on success) or deleted (on failure) on the worker
+ // pool, prior to calling |callback|.
+ static void StoreLogs(const base::FilePath& fileshelf,
+ bool should_compress,
+ const StoreLogsCallback& callback);
+
+ // Stores both system and user logs in .tgz archive on the |fileshelf|.
+ // |sequence_token_name| defines named sequence for task running on
+ // blocking pool (file operations).
+ static void StoreCombinedLogs(const base::FilePath& fileshelf,
+ const std::string& sequence_token_name,
+ const StoreLogsCallback& callback);
+
+ private:
+ DebugLogWriter();
+ DISALLOW_COPY_AND_ASSIGN(DebugLogWriter);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_DEBUG_LOG_WRITER_H_
« no previous file with comments | « no previous file | chrome/browser/chromeos/system_logs/debug_log_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698