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

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

Issue 2840103002: Add new API function: feedbackPrivate.readLogSource (Closed)
Patch Set: Refactor passing of params from API into Log Source Created 3 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/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 1ec44df4fd974260580f4c8873808ea3f1db93f8..373c21f5d8a9468233b0819f409f5f702e16fa5f 100644
--- a/chrome/common/extensions/api/feedback_private.idl
+++ b/chrome/common/extensions/api/feedback_private.idl
@@ -95,11 +95,55 @@ namespace feedbackPrivate {
closed
};
+ // Allowed log sources on Chrome OS.
+ enum LogSource {
+ // Chrome OS system messages.
+ messages,
+
+ // Latest Chrome OS UI logs.
+ uiLatest
+ };
+
+ // 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 $(ref:readLogSource) is called, the file read will
+ // continue where it left off. $(ref:readLogSource) can be called with
+ // <code>incremental=true</code> repeatedly. To subsequently close the file
+ // handle, pass in incremental=false.
tbarzic 2017/06/06 20:27:26 <code>incremental=false</code>
Simon Que 2017/06/06 22:29:15 Done.
+ 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
tbarzic 2017/06/06 20:27:26 $(ref:readLogSoruce)
Simon Que 2017/06/06 22:29:15 Done.
+ // 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;
+ };
+
+ // Result returned from a readLogSource() call.
+ dictionary ReadLogSourceResult {
+ // The ID of the log source reader that was created to read from the log
+ // source. If the reader was destroyed at the end of a read by passing in
+ // <code>incremental=false</false>, this is always set to 0. If the call was
tbarzic 2017/06/06 20:27:26 s/</false>/</code>
Simon Que 2017/06/06 22:29:15 Done.
+ // to use an existing reader with an existing ID, this will be set to the
+ // same <code>readerId</code> that was passed into readLogSource().
+ long readerId;
+
+ // Each DOMString in this array represents one line of logging that was
+ // fetched from the log source.
+ DOMString[] logLines;
+ };
+
callback GetUserEmailCallback = void(DOMString email);
callback GetSystemInformationCallback =
void(SystemInformation[] systemInformation);
callback SendFeedbackCallback = void(Status status);
callback GetStringsCallback = void(object result);
+ callback ReadLogSourceCallback = void (ReadLogSourceResult result);
interface Functions {
// Returns the email of the currently active or logged in user.
@@ -120,6 +164,26 @@ 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 <code>source</code>.
+ // <br>If <code>incremental</code> is false:
tbarzic 2017/06/06 20:27:26 prefer <p></p> over <br>
Simon Que 2017/06/06 22:29:15 Done.
+ // <ul><li>Returns the entire contents of the log file.</li>
+ // <li>Returns <code>readerId</code> value of 0 to callback.</li></ul>
tbarzic 2017/06/06 20:27:26 can you format this so it's a bit more readable fr
Simon Que 2017/06/06 22:29:15 Done.
+ // If <code>incremental</code> is true, and no <code>readerId</code> is
+ // provided:
+ // <ul><li>Returns the entire contents of the log file.</li>
+ // <li>Starts tracking the file read handle, which is returned as a nonzero
+ // <code>readerId</code> value in the callback.</li>
+ // <li>If can't create a new file handle, returns <code>readerId</code>
+ // value of 0 in the callback.</li></ul>
+ // If <code>incremental</code> is true, and a valid non-zero
+ // <code>readerId</code> is provided:
+ // <ul><li>Returns new lines written to the file since the last time this
+ // function was called for the same file and readerId.</li>
+ // <li>Returns the same <code>readerId</code> value to the
+ // callback.</li></ul>
+ static void readLogSource(ReadLogSourceParams params,
+ ReadLogSourceCallback callback);
};
interface Events {

Powered by Google App Engine
This is Rietveld 408576698