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

Issue 2603523002: Move net-export thread-hopping code into NetLogFileWriter and add IO polled data. (Closed)

Created:
4 years ago by wangyix
Modified:
3 years, 10 months ago
CC:
eroman, xunjieli
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move net-export thread-hopping code into NetLogFileWriter and add IO polled data. (1) Use net::FileNetLogObserver in place of net::WriteToFileNetLogObserver for chrome://net-export (which is a big part of crbug.com/679030). (2) Move NetLogFileWriter's public interface from the FILE_USER_BLOCKING to the UI thread (internalizing the post tasks to file thread/UI thread to simplify things) (3) Add plumbing for passing polled data, which will be collected on both the UI thread and IO thread (crbug.com/438656). Some of the refactor done will also facilitate crbug.com/679021, which is just a few extra lines. In this CL, only the polled data from the IO thread will be retrieved; the UI thread polled data will be added in a follow-up CL. BUG=679030, 438656, 679021 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester Review-Url: https://codereview.chromium.org/2603523002 Cr-Commit-Position: refs/heads/master@{#446875} Committed: https://chromium.googlesource.com/chromium/src/+/8ae679d977a7eb3c784d7bc6483cdf74400b52bd

Patch Set 1 #

Patch Set 2 : Updated net_export_ui.cc to work with the updated NetLogFileWriter #

Patch Set 3 : Various refactors to make code cleaner #

Total comments: 75

Patch Set 4 : Fixed nits; callbacks are now always executed regardless of failure or no-op #

Total comments: 54

Patch Set 5 : Fixed Eric's comments; all callbacks are now async #

Total comments: 20

Patch Set 6 : Updated NetLogFileWriter unit-test to work with new NetLogFileWriter #

Patch Set 7 : Fixed Eric's nits. StartNetLog() callback will now wait til after an already-ongoing initialization. #

Patch Set 8 : Updated android cronet and ios net_export_ui.cc #

Total comments: 15

Patch Set 9 : Fixed Eric's comments from patchset 8 #

Total comments: 19

Patch Set 10 : Fixed Eric's comments from patchset 9 about unit-test. #

Patch Set 11 : GetState() now waits until after ongoing initialization finishes to run callback #

Patch Set 12 : Fixed free-after-return issue FileWriterGetFilePathToCompletedLog() #

Total comments: 18

Patch Set 13 : Fixed Eric's comments from patchset 12 #

Total comments: 4

Patch Set 14 : Fixed tommycli's nits from patchset 13 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1134 lines, -832 lines) Patch
M chrome/browser/ui/webui/net_export_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +67 lines, -118 lines 0 comments Download
M components/cronet/android/cronet_url_request_context_adapter.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M components/net_log/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M components/net_log/net_log_file_writer.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +189 lines, -96 lines 0 comments Download
M components/net_log/net_log_file_writer.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +297 lines, -159 lines 0 comments Download
M components/net_log/net_log_file_writer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +469 lines, -307 lines 0 comments Download
M components/net_log/resources/net_export.js View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -5 lines 0 comments Download
M ios/chrome/browser/ui/webui/net_export/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M ios/chrome/browser/ui/webui/net_export/net_export_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +60 lines, -98 lines 0 comments Download
M net/log/file_net_log_observer.h View 1 chunk +3 lines, -4 lines 0 comments Download
M net/log/file_net_log_observer.cc View 1 2 3 4 8 chunks +17 lines, -19 lines 0 comments Download
M net/log/file_net_log_observer_unittest.cc View 1 2 3 4 5 4 chunks +19 lines, -25 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 66 (38 generated)
wangyix
This is a very rough attempt at moving all the thread-hopping code into NetLogFileWriter. It ...
4 years ago (2016-12-22 23:38:49 UTC) #2
wangyix
Added more reviewers, PTAL. NetLogFileWriter has been refactored, and NetExportMessageHandler has been updated to work ...
3 years, 11 months ago (2017-01-06 01:10:12 UTC) #5
wangyix
3 years, 11 months ago (2017-01-06 01:11:37 UTC) #6
eroman
The overall design looks good! I have a number of comments on the implementation details. ...
3 years, 11 months ago (2017-01-06 21:46:24 UTC) #7
eroman
Oh and also: There is an iOS version of net_export_ui.cc which will need to be ...
3 years, 11 months ago (2017-01-06 21:55:05 UTC) #8
wangyix1
https://codereview.chromium.org/2603523002/diff/40001/chrome/browser/ui/webui/net_export_ui.cc File chrome/browser/ui/webui/net_export_ui.cc (right): https://codereview.chromium.org/2603523002/diff/40001/chrome/browser/ui/webui/net_export_ui.cc#newcode65 chrome/browser/ui/webui/net_export_ui.cc:65: // functions except SendEmail run on FILE_USER_BLOCKING thread. On ...
3 years, 11 months ago (2017-01-10 22:20:16 UTC) #10
eroman
This is looking good, thanks for iterating on it! This still needs the accompanying modifications ...
3 years, 11 months ago (2017-01-11 19:18:40 UTC) #11
wangyix1
NetLogFileWriter has been updated with fixes for Eric's comments, but no unit test yet. Major ...
3 years, 11 months ago (2017-01-14 02:15:47 UTC) #13
mmenke
Going to go ahead and remove myself as a reviewer, and defer to eroman on ...
3 years, 11 months ago (2017-01-17 17:38:13 UTC) #14
eroman
For the CL description, please copy the title to the CL description. Because when you ...
3 years, 11 months ago (2017-01-18 21:32:43 UTC) #17
wangyix1
Patchset 6: added unit test for NetLogFileWriter, but haven't fixed comments from Patchset 5 yet. ...
3 years, 11 months ago (2017-01-18 23:18:05 UTC) #21
wangyix1
Patchset 7: comments from patchset 5 addressed. Also, NetLogFileWriter unit-test BUILD file was updated so ...
3 years, 11 months ago (2017-01-19 23:09:46 UTC) #24
eroman
https://codereview.chromium.org/2603523002/diff/140001/components/net_log/net_log_file_writer.cc File components/net_log/net_log_file_writer.cc (right): https://codereview.chromium.org/2603523002/diff/140001/components/net_log/net_log_file_writer.cc#newcode93 components/net_log/net_log_file_writer.cc:93: void NetLogFileWriter::StartNetLogAfterInitialized( style: in chrome code we try to ...
3 years, 11 months ago (2017-01-21 02:17:40 UTC) #34
wangyix1
Fixed Eric's comments from patchset 8. https://codereview.chromium.org/2603523002/diff/140001/components/net_log/net_log_file_writer.cc File components/net_log/net_log_file_writer.cc (right): https://codereview.chromium.org/2603523002/diff/140001/components/net_log/net_log_file_writer.cc#newcode93 components/net_log/net_log_file_writer.cc:93: void NetLogFileWriter::StartNetLogAfterInitialized( On ...
3 years, 11 months ago (2017-01-23 20:16:43 UTC) #35
eroman
https://codereview.chromium.org/2603523002/diff/160001/components/net_log/net_log_file_writer_unittest.cc File components/net_log/net_log_file_writer_unittest.cc (right): https://codereview.chromium.org/2603523002/diff/160001/components/net_log/net_log_file_writer_unittest.cc#newcode79 components/net_log/net_log_file_writer_unittest.cc:79: void RunTaskRunnersUntilIdle( I think a better approach is to ...
3 years, 11 months ago (2017-01-24 20:01:36 UTC) #36
wangyix1
PTAL. https://codereview.chromium.org/2603523002/diff/140001/components/net_log/net_log_file_writer.cc File components/net_log/net_log_file_writer.cc (right): https://codereview.chromium.org/2603523002/diff/140001/components/net_log/net_log_file_writer.cc#newcode315 components/net_log/net_log_file_writer.cc:315: if (state_callback_wait_if_already_initializing) { On 2017/01/21 02:17:40, eroman (slow) ...
3 years, 11 months ago (2017-01-25 22:48:28 UTC) #37
eroman
lgtm https://codereview.chromium.org/2603523002/diff/160001/components/net_log/net_log_file_writer_unittest.cc File components/net_log/net_log_file_writer_unittest.cc (right): https://codereview.chromium.org/2603523002/diff/160001/components/net_log/net_log_file_writer_unittest.cc#newcode398 components/net_log/net_log_file_writer_unittest.cc:398: for (int i = 0; i < 3; ...
3 years, 11 months ago (2017-01-27 02:23:24 UTC) #44
wangyix1
https://codereview.chromium.org/2603523002/diff/220001/components/net_log/net_log_file_writer_unittest.cc File components/net_log/net_log_file_writer_unittest.cc (right): https://codereview.chromium.org/2603523002/diff/220001/components/net_log/net_log_file_writer_unittest.cc#newcode132 components/net_log/net_log_file_writer_unittest.cc:132: base::WaitableEvent* done_event) { On 2017/01/27 02:23:23, eroman (slow) wrote: ...
3 years, 10 months ago (2017-01-27 18:21:09 UTC) #49
wangyix1
Adding mmenke@ and tommycli@ for OWNER status
3 years, 10 months ago (2017-01-27 18:32:31 UTC) #51
mmenke
On 2017/01/27 18:32:31, wangyix1 wrote: > Adding mmenke@ and tommycli@ for OWNER status Which files ...
3 years, 10 months ago (2017-01-27 18:40:33 UTC) #52
wangyix1
On 2017/01/27 18:40:33, mmenke (Out Feb 4 to March 5) wrote: > On 2017/01/27 18:32:31, ...
3 years, 10 months ago (2017-01-27 18:54:14 UTC) #53
mmenke
On 2017/01/27 18:54:14, wangyix1 wrote: > On 2017/01/27 18:40:33, mmenke (Out Feb 4 to March ...
3 years, 10 months ago (2017-01-27 18:58:51 UTC) #54
tommycli
lgtm https://codereview.chromium.org/2603523002/diff/240001/chrome/browser/ui/webui/net_export_ui.cc File chrome/browser/ui/webui/net_export_ui.cc (right): https://codereview.chromium.org/2603523002/diff/240001/chrome/browser/ui/webui/net_export_ui.cc#newcode93 chrome/browser/ui/webui/net_export_ui.cc:93: net::NetLogCaptureMode capture_mode); indent is off. did you run ...
3 years, 10 months ago (2017-01-27 19:11:24 UTC) #55
wangyix1
https://codereview.chromium.org/2603523002/diff/240001/chrome/browser/ui/webui/net_export_ui.cc File chrome/browser/ui/webui/net_export_ui.cc (right): https://codereview.chromium.org/2603523002/diff/240001/chrome/browser/ui/webui/net_export_ui.cc#newcode93 chrome/browser/ui/webui/net_export_ui.cc:93: net::NetLogCaptureMode capture_mode); On 2017/01/27 19:11:24, tommycli wrote: > indent ...
3 years, 10 months ago (2017-01-27 21:53:12 UTC) #56
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/2603523002/260001
3 years, 10 months ago (2017-01-27 21:54:27 UTC) #59
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/108856)
3 years, 10 months ago (2017-01-27 23:57:35 UTC) #61
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/2603523002/260001
3 years, 10 months ago (2017-01-28 01:00:10 UTC) #63
commit-bot: I haz the power
3 years, 10 months ago (2017-01-28 01:48:21 UTC) #66
Message was sent while issue was closed.
Committed patchset #14 (id:260001) as
https://chromium.googlesource.com/chromium/src/+/8ae679d977a7eb3c784d7bc6483c...

Powered by Google App Engine
This is Rietveld 408576698