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

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: all works Created 6 years, 6 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
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..054460a904498b8b3a7a3e78b127898717bb40de
--- /dev/null
+++ b/chrome/browser/chromeos/system_logs/debug_log_writer.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
Zachary Kuznia 2014/06/25 00:05:53 Nit: no (c)
zel 2014/06/27 19:31:00 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
Zachary Kuznia 2014/06/25 00:05:53 nit: empty line before ifndef
zel 2014/06/27 19:31:01 Done.
+#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.h"
+#include "base/files/file_path.h"
+
+namespace chromeos {
+
+class DebugLogWriter {
+public:
+ // Called once StoreDebugLogs is complete. Takes two parameters:
xiaowenx 2014/06/25 05:30:44 The function is called "StoreLogs", not "StoreDebu
zel 2014/06/27 19:31:01 Done.
+ // - 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 succeded)> StoreDebugLogsCallback;
Zachary Kuznia 2014/06/25 00:05:53 s/succeded/succeeded/
zel 2014/06/27 19:31:00 Done.
+
+ // Stores debug logs in the .tgz archive 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,
+ const StoreDebugLogsCallback& callback);
+
+private:
+ DebugLogWriter();
+ DISALLOW_COPY_AND_ASSIGN(DebugLogWriter);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_DEBUG_LOG_WRITER_H_

Powered by Google App Engine
This is Rietveld 408576698