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

Issue 2785523002: Reduce/remove usage of BrowserThread in content/browser/loader. (Closed)

Created:
3 years, 8 months ago by ananta
Modified:
3 years, 8 months ago
Reviewers:
jam
CC:
chromium-reviews, loading-reviews_chromium.org, jam, darin-cc_chromium.org, Randy Smith (Not in Mondays), mmenke
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Reduce/remove usage of BrowserThread in content/browser/loader. This patch removes usage of BrowserThread for the UI and IO threads from a number of files in content/browser/loader. I left the navigation_resource_throttle.cc/.h, navigation_url_loader_impl.cc, navigation_url_loader_impl_core.cc/.h as is. The expectation being these files will not be part of the network service. Following changes in this patch. 1. ResourceDispatcherHostImpl maintains a scoped reference to the task runners for the UI and IO threads. 2. We pass the task runners to the classes which need them like ResourceMessageFilter, URLLoaderFactoryImpl, etc. 3. The other changes are mostly removing usage of DCHECK_CURRENTLY_ON and PostTask for BrowserThread. I left BrowserThread::FILE as is as that is going away soon. BUG=598073 Review-Url: https://codereview.chromium.org/2785523002 Cr-Commit-Position: refs/heads/master@{#461625} Committed: https://chromium.googlesource.com/chromium/src/+/a094fc10467ca10732cf02d489565c4d4322890d

Patch Set 1 #

Patch Set 2 : Rebased to tip #

Patch Set 3 : Fix formatting #

Patch Set 4 : Fix test redness #

Total comments: 1

Patch Set 5 : Fix unittests redness #

Total comments: 18

Patch Set 6 : Isolate the LoaderGlobals fake initialization in the RenderViewHostTestEnabler::InitHacks function #

Patch Set 7 : Address review comments #

Total comments: 1

Patch Set 8 : Fix ASAN redness #

Patch Set 9 : Update DEPS and revert resource_request_info_impl.cc #

Total comments: 2

Patch Set 10 : Pass task runners to ResourceMessageFilter in the ctor #

Patch Set 11 : Remove the LoaderGlobals class and move the task runners to RDHI #

Patch Set 12 : Remove stray include #

Total comments: 4

Patch Set 13 : Address review comments #

Patch Set 14 : Remove DCHECK #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -83 lines) Patch
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -1 line 0 comments Download
M content/browser/loader/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/loader/async_resource_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +17 lines, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 15 chunks +33 lines, -30 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -2 lines 0 comments Download
M content/browser/loader/resource_hints_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +7 lines, -3 lines 0 comments Download
M content/browser/loader/resource_loader.h View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/loader/resource_loader.cc View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/loader/resource_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +12 lines, -8 lines 0 comments Download
M content/browser/loader/resource_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +15 lines, -12 lines 0 comments Download
M content/browser/loader/resource_requester_info.cc View 1 2 3 4 5 6 2 chunks +0 lines, -2 lines 0 comments Download
M content/browser/loader/url_loader_factory_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -2 lines 0 comments Download
M content/browser/loader/url_loader_factory_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +17 lines, -11 lines 0 comments Download
M content/browser/loader/url_loader_factory_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +8 lines, -4 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_fetch_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 60 (48 generated)
ananta
3 years, 8 months ago (2017-03-28 20:56:39 UTC) #2
jam
I think a bunch of these places don't need to change; left comments. the remaining ...
3 years, 8 months ago (2017-03-29 15:44:33 UTC) #28
ananta
Thanks for the review. I should have looked at this https://docs.google.com/spreadsheets/d/1ot0WOgC2TrMY5VADo2ijmx98Z792FojUKJncG5u3QRo/edit#gid=0 before sending this patch ...
3 years, 8 months ago (2017-03-29 19:41:04 UTC) #29
ananta
https://codereview.chromium.org/2785523002/diff/120001/content/browser/loader/url_loader_factory_impl.cc File content/browser/loader/url_loader_factory_impl.cc (right): https://codereview.chromium.org/2785523002/diff/120001/content/browser/loader/url_loader_factory_impl.cc#newcode42 content/browser/loader/url_loader_factory_impl.cc:42: DCHECK( ThreadChecker can be used here. However static functions ...
3 years, 8 months ago (2017-03-29 19:43:55 UTC) #30
jam
On 2017/03/29 19:41:04, ananta wrote: > Thanks for the review. I should have looked at ...
3 years, 8 months ago (2017-03-30 17:34:09 UTC) #42
ananta
I removed the LoaderGlobals class and moved the runners to RDHI. https://codereview.chromium.org/2785523002/diff/80001/content/browser/loader/resource_message_filter.cc File content/browser/loader/resource_message_filter.cc (right): ...
3 years, 8 months ago (2017-03-30 22:51:22 UTC) #44
jam
lgtm with comments sorry for the delay https://codereview.chromium.org/2785523002/diff/210001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2785523002/diff/210001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode343 content/browser/loader/resource_dispatcher_host_impl.cc:343: const scoped_refptr<base::SingleThreadTaskRunner>& ...
3 years, 8 months ago (2017-04-03 14:47:03 UTC) #49
ananta
https://codereview.chromium.org/2785523002/diff/210001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2785523002/diff/210001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode343 content/browser/loader/resource_dispatcher_host_impl.cc:343: const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_runner, On 2017/04/03 14:47:03, jam (busy till ...
3 years, 8 months ago (2017-04-03 22:58:19 UTC) #50
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/2785523002/250001
3 years, 8 months ago (2017-04-03 23:03:50 UTC) #53
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/422531)
3 years, 8 months ago (2017-04-04 00:33:19 UTC) #55
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/2785523002/250001
3 years, 8 months ago (2017-04-04 00:53:28 UTC) #57
commit-bot: I haz the power
3 years, 8 months ago (2017-04-04 04:12:08 UTC) #60
Message was sent while issue was closed.
Committed patchset #14 (id:250001) as
https://chromium.googlesource.com/chromium/src/+/a094fc10467ca10732cf02d48956...

Powered by Google App Engine
This is Rietveld 408576698