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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Use the <code>chrome.feedbackPrivate</code> API to provide Chrome [OS] 5 // Use the <code>chrome.feedbackPrivate</code> API to provide Chrome [OS]
6 // feedback to the Google Feedback servers. 6 // feedback to the Google Feedback servers.
7 namespace feedbackPrivate { 7 namespace feedbackPrivate {
8 8
9 dictionary AttachedFile { 9 dictionary AttachedFile {
10 DOMString name; 10 DOMString name;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // User clicked the "Learn More" button. 84 // User clicked the "Learn More" button.
85 accepted, 85 accepted,
86 86
87 // User declined the prompt and proceeded to the feedback page. 87 // User declined the prompt and proceeded to the feedback page.
88 declined, 88 declined,
89 89
90 // User closed the window altogether. 90 // User closed the window altogether.
91 closed 91 closed
92 }; 92 };
93 93
94 // Allowed log sources on Chrome OS.
95 enum LogSource {
96 // /var/log/messages
97 messages,
98
99 // /var/log/ui/ui.LATEST
100 ui_latest
101 };
102
103 // Input parameters for a readLogSource() call.
104 dictionary ReadLogSourceParams {
105 // The log source from which to read.
106 LogSource source;
107
108 // For file-based log sources, read from source without closing the file
109 // handle. The next time readLogSource() is called, the file read will
110 // continue where it left off. readLogSource() can be called with
111 // incremental=true repeatedly. To subsequently close the file handle, pass
112 // in incremental=false.
113 boolean incremental;
114
115 // To read from an existing file handle, set this to a valid readerId value
116 // that was returned from a previous readLogSource() call. The file handle
117 // must previously have been created for the same |source|. If no readerId
118 // is provided, readLogSource will attempt to open a new log source reader
119 // handle.
120 long? readerId;
121 };
122
94 callback GetUserEmailCallback = void(DOMString email); 123 callback GetUserEmailCallback = void(DOMString email);
95 callback GetSystemInformationCallback = 124 callback GetSystemInformationCallback =
96 void(SystemInformation[] systemInformation); 125 void(SystemInformation[] systemInformation);
97 callback SendFeedbackCallback = void(Status status); 126 callback SendFeedbackCallback = void(Status status);
98 callback GetStringsCallback = void(object result); 127 callback GetStringsCallback = void(object result);
128 callback ReadLogSourceCallback = void (long readerId, DOMString[] logLines);
99 129
100 interface Functions { 130 interface Functions {
101 // Returns the email of the currently active or logged in user. 131 // Returns the email of the currently active or logged in user.
102 static void getUserEmail(GetUserEmailCallback callback); 132 static void getUserEmail(GetUserEmailCallback callback);
103 133
104 // Returns the system information dictionary. 134 // Returns the system information dictionary.
105 static void getSystemInformation(GetSystemInformationCallback callback); 135 static void getSystemInformation(GetSystemInformationCallback callback);
106 136
107 // Sends a feedback report. 137 // Sends a feedback report.
108 static void sendFeedback(FeedbackInfo feedback, 138 static void sendFeedback(FeedbackInfo feedback,
109 SendFeedbackCallback callback); 139 SendFeedbackCallback callback);
110 140
111 // Gets localized translated strings for feedback. It returns the 141 // Gets localized translated strings for feedback. It returns the
112 // strings as a dictionary mapping from string identifier to the 142 // strings as a dictionary mapping from string identifier to the
113 // translated string to use in the feedback app UI. 143 // translated string to use in the feedback app UI.
114 static void getStrings(GetStringsCallback callback); 144 static void getStrings(GetStringsCallback callback);
115 145
116 // Logs whether the user accepted a prompt to try the Software Removal 146 // Logs whether the user accepted a prompt to try the Software Removal
117 // Tool. 147 // Tool.
118 static void logSrtPromptResult(SrtPromptResult result); 148 static void logSrtPromptResult(SrtPromptResult result);
149
150 // 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.
151 //
152 // If |incremental| is false:
153 // - Returns the entire contents of the log file.
154 // - Returns |readerId| value of 0 to callback.
155 // If |incremental| is true, and no |readerId| is provided:
156 // - Returns the entire contents of the log file.
157 // - Starts tracking the file read handle, which is returned as a nonzero
158 // |readerId| value in the callback.
159 // - If can't create a new file handle, returns |readerId| value of 0 in the
160 // callback.
161 // If |incremental| is true, and a valid non-zero |readerId| is provided:
162 // - Returns new lines written to the file since the last time this function
163 // was called for the same file and readerId.
164 // - Returns the same |readerId| value to the callback.
165 static void readLogSource(ReadLogSourceParams params,
166 ReadLogSourceCallback callback);
119 }; 167 };
120 168
121 interface Events { 169 interface Events {
122 // Fired when the a user requests the launch of the feedback UI. We're 170 // Fired when the a user requests the launch of the feedback UI. We're
123 // using an event for this versus using the override API since we want 171 // using an event for this versus using the override API since we want
124 // to be invoked, but not showing a UI, so the feedback extension can 172 // to be invoked, but not showing a UI, so the feedback extension can
125 // take a screenshot of the user's desktop. 173 // take a screenshot of the user's desktop.
126 static void onFeedbackRequested(FeedbackInfo feedback); 174 static void onFeedbackRequested(FeedbackInfo feedback);
127 }; 175 };
128 }; 176 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698