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

Unified Diff: chrome/common/extensions/api/feedback_private.idl

Issue 2840103002: Add new API function: feedbackPrivate.readLogSource (Closed)
Patch Set: Addressed comments from Patch Set 4 Created 3 years, 7 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/common/extensions/api/feedback_private.idl
diff --git a/chrome/common/extensions/api/feedback_private.idl b/chrome/common/extensions/api/feedback_private.idl
index fe52a422dc39b24ef3471382e71ff501d177bdb8..c893dde82fff41d6d7cc8260a6b8acabde02099a 100644
--- a/chrome/common/extensions/api/feedback_private.idl
+++ b/chrome/common/extensions/api/feedback_private.idl
@@ -91,11 +91,41 @@ namespace feedbackPrivate {
closed
};
+ // Allowed log sources on Chrome OS.
+ enum LogSource {
+ // /var/log/messages
+ messages,
+
+ // /var/log/ui/ui.LATEST
+ ui_latest
+ };
+
+ // Input parameters for a readLogSource() call.
+ dictionary ReadLogSourceParams {
+ // The log source from which to read.
+ LogSource source;
+
+ // For file-based log sources, read from source without closing the file
+ // handle. The next time readLogSource() is called, the file read will
+ // continue where it left off. readLogSource() can be called with
+ // incremental=true repeatedly. To subsequently close the file handle, pass
+ // in incremental=false.
+ boolean incremental;
+
+ // To read from an existing file handle, set this to a valid readerId value
+ // that was returned from a previous readLogSource() call. The file handle
+ // must previously have been created for the same |source|. If no readerId
+ // is provided, readLogSource will attempt to open a new log source reader
+ // handle.
+ long? readerId;
+ };
+
callback GetUserEmailCallback = void(DOMString email);
callback GetSystemInformationCallback =
void(SystemInformation[] systemInformation);
callback SendFeedbackCallback = void(Status status);
callback GetStringsCallback = void(object result);
+ callback ReadLogSourceCallback = void (long readerId, DOMString[] logLines);
interface Functions {
// Returns the email of the currently active or logged in user.
@@ -116,6 +146,24 @@ namespace feedbackPrivate {
// Logs whether the user accepted a prompt to try the Software Removal
// Tool.
static void logSrtPromptResult(SrtPromptResult result);
+
+ // Reads from a log source indicated by |source|.
Simon Que 2017/05/24 19:30:47 I should document that it is only supported on Chr
rkc 2017/05/24 19:58:11 This should self-document via the docserver parsin
Simon Que 2017/05/24 20:07:17 I don't see any reference to Chrome OS in that fil
rkc 2017/05/24 20:27:43 So we should definitely restrict this via _permiss
Simon Que 2017/05/30 17:52:54 Toni, got any opinion on this?
tbarzic 2017/05/30 19:35:35 I'd be fine with restricting this using features s
Simon Que 2017/06/01 00:06:40 Done.
+ //
+ // If |incremental| is false:
+ // - Returns the entire contents of the log file.
+ // - Returns |readerId| value of 0 to callback.
+ // If |incremental| is true, and no |readerId| is provided:
+ // - Returns the entire contents of the log file.
+ // - Starts tracking the file read handle, which is returned as a nonzero
+ // |readerId| value in the callback.
+ // - If can't create a new file handle, returns |readerId| value of 0 in the
+ // callback.
+ // If |incremental| is true, and a valid non-zero |readerId| is provided:
+ // - Returns new lines written to the file since the last time this function
+ // was called for the same file and readerId.
+ // - Returns the same |readerId| value to the callback.
+ static void readLogSource(ReadLogSourceParams params,
+ ReadLogSourceCallback callback);
};
interface Events {

Powered by Google App Engine
This is Rietveld 408576698