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

Issue 2840103002: Add new API function: feedbackPrivate.readLogSource (Closed)

Created:
3 years, 7 months ago by Simon Que
Modified:
3 years, 6 months ago
Reviewers:
Mark P, tbarzic
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, Devlin, rkc
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add new API function: feedbackPrivate.readLogSource This function from a single log source (e.g. a log file). If the log source is a log file, this function can continuously read new lines from it. The function also contains mechanisms to prevent excessive log source access. BUG=715263 Review-Url: https://codereview.chromium.org/2840103002 Cr-Commit-Position: refs/heads/master@{#479160} Committed: https://chromium.googlesource.com/chromium/src/+/055672cc4d3da15292acfc7d6953c6d21e9b3813

Patch Set 1 #

Total comments: 12

Patch Set 2 : Add LogSource enum, updated API function to use readerId #

Patch Set 3 : Fully functional now #

Patch Set 4 : Add comments to SingleLogSourceFactory; Add new histogram enum #

Total comments: 35

Patch Set 5 : Addressed comments from Patch Set 4 #

Total comments: 21

Patch Set 6 : Addressed tbarzic's comments from Patch Set 4 and 5 #

Total comments: 7

Patch Set 7 : Add API unit test; create CrOS-specific test module; minor fixes/refactors #

Total comments: 1

Patch Set 8 : Add more unit tests; delete API tests; update permissions #

Patch Set 9 : Rebased; updated histogram enum #

Total comments: 58

Patch Set 10 : addressed comments from patch set 9 #

Patch Set 11 : Moved most functionality to LogSourceAccessManager; Minor refactors #

Patch Set 12 : Remove LogSourceAccessManagerTest #

Patch Set 13 : Remove unused function #

Patch Set 14 : Refactor passing of params from API into Log Source #

Total comments: 64

Patch Set 15 : Responded to comments from Patch Set 14 #

Total comments: 22

Patch Set 16 : Get profile() directly; Call RunFunctionAndReturn*(); Separate success and error function calls #

Patch Set 17 : Addressed Comments from patch set 15 #

Patch Set 18 : Missed a few things; Check max number of readers per source #

Patch Set 19 : Rebased. #

Total comments: 1

Patch Set 20 : Remove TODO #

Patch Set 21 : Rebased #

Patch Set 22 : Rebased #

Patch Set 23 : Add proper ifdefs for non-CrOS platforms #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1241 lines, -10 lines) Patch
M chrome/browser/extensions/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/feedback_private/feedback_private_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +33 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/feedback_private/feedback_private_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +50 lines, -8 lines 0 comments Download
A chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +392 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/feedback_private/log_source_access_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +144 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/feedback_private/log_source_access_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +222 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/feedback_private/log_source_access_manager_chromeos_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +159 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/feedback_private/log_source_resource.h View 1 2 3 4 5 6 7 8 9 1 chunk +50 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/feedback_private/log_source_resource.cc View 1 2 3 4 5 6 7 8 9 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/feedback_private/single_log_source_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +37 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/feedback_private/single_log_source_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +33 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/_api_features.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/feedback_private.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +73 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/browser/extension_function_histogram_value.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -1 line 0 comments Download
M tools/metrics/histograms/enums.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 70 (22 generated)
rkc
https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl#newcode122 chrome/common/extensions/api/feedback_private.idl:122: // Reads from a log file |filename|, starting from ...
3 years, 7 months ago (2017-04-26 03:08:43 UTC) #2
Simon Que
https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl#newcode122 chrome/common/extensions/api/feedback_private.idl:122: // Reads from a log file |filename|, starting from ...
3 years, 7 months ago (2017-04-26 14:08:19 UTC) #3
rkc
https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl#newcode122 chrome/common/extensions/api/feedback_private.idl:122: // Reads from a log file |filename|, starting from ...
3 years, 7 months ago (2017-04-26 16:17:18 UTC) #4
Simon Que
https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl#newcode122 chrome/common/extensions/api/feedback_private.idl:122: // Reads from a log file |filename|, starting from ...
3 years, 7 months ago (2017-04-26 18:42:44 UTC) #5
rkc
https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl#newcode122 chrome/common/extensions/api/feedback_private.idl:122: // Reads from a log file |filename|, starting from ...
3 years, 7 months ago (2017-04-26 18:46:34 UTC) #6
Simon Que
https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/1/chrome/common/extensions/api/feedback_private.idl#newcode122 chrome/common/extensions/api/feedback_private.idl:122: // Reads from a log file |filename|, starting from ...
3 years, 7 months ago (2017-04-26 19:46:39 UTC) #7
tbarzic
Sorry, I didn't realize this was up for review. (you should use "Publish+Mail Comments" when ...
3 years, 7 months ago (2017-05-22 23:02:55 UTC) #10
Simon Que
Let's revisit the apitest -- perhaps it should be a API unit test instead. https://codereview.chromium.org/2840103002/diff/60001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc ...
3 years, 7 months ago (2017-05-23 20:01:20 UTC) #11
Simon Que
https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl#newcode150 chrome/common/extensions/api/feedback_private.idl:150: // Reads from a log source indicated by |source|. ...
3 years, 7 months ago (2017-05-24 19:30:47 UTC) #12
rkc
https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl#newcode150 chrome/common/extensions/api/feedback_private.idl:150: // Reads from a log source indicated by |source|. ...
3 years, 7 months ago (2017-05-24 19:58:12 UTC) #14
Simon Que
m https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl#newcode150 chrome/common/extensions/api/feedback_private.idl:150: // Reads from a log source indicated by ...
3 years, 7 months ago (2017-05-24 20:07:17 UTC) #15
rkc
If this call isn't restricted to Chrome OS in _permission_features, then this API isn't really ...
3 years, 7 months ago (2017-05-24 20:09:56 UTC) #16
Simon Que
On 2017/05/24 20:09:56, rkc wrote: > If this call isn't restricted to Chrome OS in ...
3 years, 7 months ago (2017-05-24 20:16:23 UTC) #17
Devlin
On 2017/05/24 19:58:12, rkc wrote: > https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl > File chrome/common/extensions/api/feedback_private.idl (right): > > https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl#newcode150 > ...
3 years, 7 months ago (2017-05-24 20:20:31 UTC) #18
rkc
https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl#newcode150 chrome/common/extensions/api/feedback_private.idl:150: // Reads from a log source indicated by |source|. ...
3 years, 7 months ago (2017-05-24 20:27:44 UTC) #19
tbarzic
On 2017/05/24 20:27:44, rkc wrote: > https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl > File chrome/common/extensions/api/feedback_private.idl (right): > > https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl#newcode150 > ...
3 years, 7 months ago (2017-05-24 20:50:54 UTC) #20
tbarzic
https://codereview.chromium.org/2840103002/diff/60001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api.cc (right): https://codereview.chromium.org/2840103002/diff/60001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc#newcode104 chrome/browser/extensions/api/feedback_private/feedback_private_api.cc:104: LogSourceResourceManager::GetFactoryInstance() { On 2017/05/23 20:01:19, Simon Que wrote: > ...
3 years, 6 months ago (2017-05-25 22:46:45 UTC) #21
Simon Que
https://codereview.chromium.org/2840103002/diff/60001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api.cc (right): https://codereview.chromium.org/2840103002/diff/60001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc#newcode104 chrome/browser/extensions/api/feedback_private/feedback_private_api.cc:104: LogSourceResourceManager::GetFactoryInstance() { On 2017/05/25 22:46:44, tbarzic wrote: > On ...
3 years, 6 months ago (2017-05-26 04:34:39 UTC) #22
Simon Que
I also think I should rewrite the API test into a unit test using the ...
3 years, 6 months ago (2017-05-30 17:52:54 UTC) #24
tbarzic
yes, I think testing more subtle behavior (e.g. concurrent requests) with unittests would make sense. ...
3 years, 6 months ago (2017-05-30 19:35:35 UTC) #25
Simon Que
On 2017/05/30 19:35:35, tbarzic wrote: > yes, I think testing more subtle behavior (e.g. concurrent ...
3 years, 6 months ago (2017-05-30 22:37:36 UTC) #26
Simon Que
I encountered more problems as I attempted to move the testing to an ApiUnitTest. =============================================== ...
3 years, 6 months ago (2017-05-31 00:21:44 UTC) #27
Simon Que
PTAL https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl File chrome/common/extensions/api/feedback_private.idl (right): https://codereview.chromium.org/2840103002/diff/80001/chrome/common/extensions/api/feedback_private.idl#newcode150 chrome/common/extensions/api/feedback_private.idl:150: // Reads from a log source indicated by ...
3 years, 6 months ago (2017-06-01 00:06:40 UTC) #28
tbarzic
https://codereview.chromium.org/2840103002/diff/120001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api.cc (right): https://codereview.chromium.org/2840103002/diff/120001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc#newcode350 chrome/browser/extensions/api/feedback_private/feedback_private_api.cc:350: I'd pass SourceAndExtension as a parameter (you'll have to ...
3 years, 6 months ago (2017-06-01 19:23:47 UTC) #29
Simon Que
https://codereview.chromium.org/2840103002/diff/160001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api.cc (right): https://codereview.chromium.org/2840103002/diff/160001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc#newcode104 chrome/browser/extensions/api/feedback_private/feedback_private_api.cc:104: } On 2017/06/01 19:23:45, tbarzic wrote: > NOTREACHED() << ...
3 years, 6 months ago (2017-06-01 21:49:10 UTC) #30
tbarzic
https://codereview.chromium.org/2840103002/diff/160001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api.cc (right): https://codereview.chromium.org/2840103002/diff/160001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc#newcode371 chrome/browser/extensions/api/feedback_private/feedback_private_api.cc:371: SingleLogSourceFactory::CreateSingleLogSource(source_type).release(), On 2017/06/01 21:49:09, Simon Que wrote: > On ...
3 years, 6 months ago (2017-06-01 21:57:24 UTC) #31
Simon Que
Now the new FeedbackPrivateReadLogSourceFunction class is just a wrapper around LogSourceAccessManager. It no longer makes ...
3 years, 6 months ago (2017-06-02 22:54:32 UTC) #32
Simon Que
On 2017/06/02 22:54:32, Simon Que wrote: > Now the new FeedbackPrivateReadLogSourceFunction class is just a ...
3 years, 6 months ago (2017-06-02 22:58:16 UTC) #33
tbarzic
On 2017/06/02 22:58:16, Simon Que wrote: > On 2017/06/02 22:54:32, Simon Que wrote: > > ...
3 years, 6 months ago (2017-06-02 23:00:34 UTC) #34
Simon Que
On 2017/06/02 23:00:34, tbarzic wrote: > On 2017/06/02 22:58:16, Simon Que wrote: > > On ...
3 years, 6 months ago (2017-06-02 23:21:12 UTC) #35
tbarzic
https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api.cc (right): https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc#newcode276 chrome/browser/extensions/api/feedback_private/feedback_private_api.cc:276: scoped_refptr<FeedbackPrivateReadLogSourceFunction> function = this; you should not need this ...
3 years, 6 months ago (2017-06-06 20:27:27 UTC) #36
Simon Que
https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api.cc (right): https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc#newcode276 chrome/browser/extensions/api/feedback_private/feedback_private_api.cc:276: scoped_refptr<FeedbackPrivateReadLogSourceFunction> function = this; On 2017/06/06 20:27:25, tbarzic wrote: ...
3 years, 6 months ago (2017-06-06 22:29:15 UTC) #37
Simon Que
https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc (right): https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc#newcode167 chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc:167: std::unique_ptr<base::ListValue> RunFunctionAndReturnValue( On 2017/06/06 22:29:14, Simon Que wrote: > ...
3 years, 6 months ago (2017-06-07 01:43:24 UTC) #38
Simon Que
https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc (right): https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc#newcode167 chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc:167: std::unique_ptr<base::ListValue> RunFunctionAndReturnValue( On 2017/06/07 01:43:24, Simon Que wrote: > ...
3 years, 6 months ago (2017-06-07 01:57:52 UTC) #39
tbarzic
https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc File chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc (right): https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc#newcode98 chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc:98: ->SetTestingFactoryAndUse(browser()->profile(), use profile() instead of browser()->profile() https://codereview.chromium.org/2840103002/diff/260001/chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc#newcode167 chrome/browser/extensions/api/feedback_private/feedback_private_api_chromeos_unittest.cc:167: std::unique_ptr<base::ListValue> ...
3 years, 6 months ago (2017-06-07 03:39:03 UTC) #40
tbarzic
few more nits and thought on tests, but generally looks good https://codereview.chromium.org/2840103002/diff/280001/chrome/browser/extensions/api/feedback_private/feedback_private_api.h File chrome/browser/extensions/api/feedback_private/feedback_private_api.h (right): ...
3 years, 6 months ago (2017-06-07 17:58:39 UTC) #41
Simon Que
Hold off on that LGTM, there's a few more corner cases I need to cover... ...
3 years, 6 months ago (2017-06-07 18:25:59 UTC) #42
Simon Que
The check for max number of active readers per source got lost in the refactor. ...
3 years, 6 months ago (2017-06-07 19:52:58 UTC) #43
Simon Que
Ping, I'd like to get this review done soon, so it can unblock some other ...
3 years, 6 months ago (2017-06-08 22:32:13 UTC) #44
tbarzic
lgtm
3 years, 6 months ago (2017-06-09 04:33:02 UTC) #45
Simon Que
rkc, can I get an OWNER approval for chrome/browser/extensions/api/feedback_private/?
3 years, 6 months ago (2017-06-09 15:44:23 UTC) #46
Simon Que
mpearson, can I get approval for extensions/browser/extension_function_histogram_value.h?
3 years, 6 months ago (2017-06-13 15:32:51 UTC) #56
Mark P
enums.xml lgtm
3 years, 6 months ago (2017-06-13 19:21:30 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2840103002/440001
3 years, 6 months ago (2017-06-13 21:24:37 UTC) #64
commit-bot: I haz the power
Committed patchset #23 (id:440001) as https://chromium.googlesource.com/chromium/src/+/055672cc4d3da15292acfc7d6953c6d21e9b3813
3 years, 6 months ago (2017-06-13 21:31:16 UTC) #67
afakhry
On 2017/06/13 21:31:16, commit-bot: I haz the power wrote: > Committed patchset #23 (id:440001) as ...
3 years, 6 months ago (2017-06-23 23:26:57 UTC) #68
Simon Que
On 2017/06/23 23:26:57, afakhry wrote: > On 2017/06/13 21:31:16, commit-bot: I haz the power wrote: ...
3 years, 6 months ago (2017-06-23 23:29:54 UTC) #69
Simon Que
3 years, 6 months ago (2017-06-23 23:30:00 UTC) #70
Message was sent while issue was closed.
On 2017/06/23 23:26:57, afakhry wrote:
> On 2017/06/13 21:31:16, commit-bot: I haz the power wrote:
> > Committed patchset #23 (id:440001) as
> >
>
https://chromium.googlesource.com/chromium/src/+/055672cc4d3da15292acfc7d6953...
> 
> Can you please add me as a reviewer of such CLs or at least CC me? I'm trying
to
> review your other change and I'm so out of context because I see a lot of
> newly-added files that I've never seen before!

No problem.

Powered by Google App Engine
This is Rietveld 408576698