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

Issue 8965025: Refactoring of job dispatch in HostResolverImpl in preparation for DnsClient. (Closed)

Created:
9 years ago by szym
Modified:
8 years, 11 months ago
Reviewers:
cbentzel, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Refactoring of job dispatch in HostResolverImpl in preparation for DnsClient. - Adds PrioritizedDispatcher (and PriorityQueue) to replace HostResolverImpl::JobPool. - Separates Job which aggregates Requests from ProcTask which executes on WorkerPool. - Queues Jobs rather than Requests before dispatching them. (So that we can queue before DnsClient and then before ProcTask.) This is the second CL in series to merge AsyncHostResolver into HostResolverImpl. BUG=107880 TEST=waterfall

Patch Set 1 : Re-upload #

Patch Set 2 : Added NET_EXPORT_PRIVATE for win_Shared. #

Patch Set 3 : Removed NET_EXPORT_PRIVATE from template. #

Total comments: 86

Patch Set 4 : Fixed PriorityQueue. #

Total comments: 38

Patch Set 5 : Addressed review. Added WouldEvict to simplify Job lifetime. Renamed to PrioritizedDispatcher #

Patch Set 6 : Completed renaming ProcJob->ProcTask. Moved priority_dispatch* to priority_dispatcher*' #

Patch Set 7 : Rebased to trunk. #

Total comments: 20

Patch Set 8 : Moved eviction logic from PrioritizedDispatcher to HostResolverImpl #

Patch Set 9 : Decoupled PriorityQueue and PrioritizedDispatcher from RequestPriority. #

Patch Set 10 : Added validity check to PriorityQueue::Pointer. #

Patch Set 11 : Moved num_priorities from Limits to PrioritizedDispatcher ctor' #

Patch Set 12 : Fixes from try bots. #

Total comments: 30
Unified diffs Side-by-side diffs Delta from patch set Stats (+1657 lines, -873 lines) Patch
M chrome/browser/net/connection_tester.cc View 1 2 3 4 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/net/passive_log_collector.h View 1 2 3 4 5 6 2 chunks +25 lines, -8 lines 0 comments Download
M chrome/browser/net/passive_log_collector.cc View 1 2 3 4 5 6 4 chunks +41 lines, -11 lines 0 comments Download
M chrome/browser/resources/net_internals/events_view.css View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/resources/net_internals/source_entry.js View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M net/base/host_resolver_impl.h View 1 2 3 4 5 6 7 6 chunks +92 lines, -187 lines 0 comments Download
M net/base/host_resolver_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 36 chunks +543 lines, -576 lines 0 comments Download
M net/base/host_resolver_impl_unittest.cc View 1 2 3 4 9 10 13 chunks +63 lines, -66 lines 0 comments Download
M net/base/net_log_event_type_list.h View 1 2 3 4 5 6 4 chunks +54 lines, -22 lines 0 comments Download
M net/base/net_log_source_type_list.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
A net/base/prioritized_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +111 lines, -0 lines 7 comments Download
A net/base/prioritized_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +105 lines, -0 lines 5 comments Download
A net/base/prioritized_dispatcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +279 lines, -0 lines 0 comments Download
A net/base/priority_queue.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +200 lines, -0 lines 17 comments Download
A net/base/priority_queue_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +129 lines, -0 lines 1 comment Download
M net/net.gyp View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
szym
This is now ready for review. PTAL.
9 years ago (2011-12-20 07:44:47 UTC) #1
szym
Working on fix for priority_queue.h on win. http://codereview.chromium.org/8965025/diff/19026/net/base/priority_queue.h File net/base/priority_queue.h (right): http://codereview.chromium.org/8965025/diff/19026/net/base/priority_queue.h#newcode33 net/base/priority_queue.h:33: bool is_null() ...
9 years ago (2011-12-20 16:48:38 UTC) #2
mmenke
A bunch of fairly minor comments. Note that I've only skimmed HostResolverImpl. http://codereview.chromium.org/8965025/diff/19026/chrome/browser/resources/net_internals/events_view.css File chrome/browser/resources/net_internals/events_view.css ...
9 years ago (2011-12-21 16:22:58 UTC) #3
szym
Thanks for the review so far. I've only added comments to where some explanation was ...
9 years ago (2011-12-21 22:19:33 UTC) #4
mmenke
Sorry, meant to get back to you with a full review later today. Got a ...
9 years ago (2011-12-21 22:35:42 UTC) #5
mmenke
http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc#newcode270 net/base/host_resolver_impl.cc:270: class HostResolverImpl::Request { Think we should add a comment ...
9 years ago (2011-12-22 16:18:49 UTC) #6
mmenke
http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc#newcode363 net/base/host_resolver_impl.cc:363: : public base::RefCountedThreadSafe<HostResolverImpl::ProcJob> { On 2011/12/22 16:18:49, Matt Menke ...
9 years ago (2011-12-22 16:19:53 UTC) #7
szym
Thanks for the review. A couple questions below. http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc#newcode832 net/base/host_resolver_impl.cc:832: explicit ...
9 years ago (2011-12-22 16:56:57 UTC) #8
mmenke
http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc#newcode832 net/base/host_resolver_impl.cc:832: explicit PriorityTracker(RequestPriority initial) On 2011/12/22 16:56:57, szym wrote: > ...
9 years ago (2011-12-22 17:34:30 UTC) #9
mmenke
http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/8965025/diff/19026/net/base/host_resolver_impl.cc#newcode997 net/base/host_resolver_impl.cc:997: proc_job_ = NULL; On 2011/12/22 17:34:30, Matt Menke wrote: ...
9 years ago (2011-12-22 17:55:14 UTC) #10
szym
Ready for another pass. http://codereview.chromium.org/8965025/diff/19026/chrome/browser/resources/net_internals/events_view.css File chrome/browser/resources/net_internals/events_view.css (right): http://codereview.chromium.org/8965025/diff/19026/chrome/browser/resources/net_internals/events_view.css#newcode76 chrome/browser/resources/net_internals/events_view.css:76: #events-view-source-list-tbody .source_HOST_RESOLVER_IMPL_PROC_JOB, On 2011/12/21 16:22:58, ...
8 years, 12 months ago (2011-12-28 01:24:10 UTC) #11
mmenke
I probably won't be able to do a review until this weekend. Was planning to ...
8 years, 12 months ago (2011-12-28 02:58:31 UTC) #12
cbentzel
I didn't take a significant look at the HostResolverImpl's usage of the PrioritizedDispatcher. I'm concerned ...
8 years, 11 months ago (2012-01-03 19:39:09 UTC) #13
szym
Thanks for the comments. I'm leaning more towards LinkedList given the preference to safely invalidate ...
8 years, 11 months ago (2012-01-03 20:48:51 UTC) #14
szym
I have updated the CL with three patches: 1) Moved eviction logic from PrioritizedDispatcher to ...
8 years, 11 months ago (2012-01-04 21:21:51 UTC) #15
cbentzel
As I mentioned in person - I think it would be good to split this ...
8 years, 11 months ago (2012-01-05 18:32:20 UTC) #16
szym
It makes sense to split this CL into two. I will do that. How do ...
8 years, 11 months ago (2012-01-05 19:00:29 UTC) #17
cbentzel
On Thu, Jan 5, 2012 at 2:00 PM, <szym@chromium.org> wrote: > It makes sense to ...
8 years, 11 months ago (2012-01-05 19:15:54 UTC) #18
cbentzel
On Thu, Jan 5, 2012 at 2:15 PM, Chris Bentzel <cbentzel@chromium.org> wrote: > > > ...
8 years, 11 months ago (2012-01-05 19:17:48 UTC) #19
szym
8 years, 11 months ago (2012-01-05 19:23:02 UTC) #20
On Thu, Jan 5, 2012 at 2:17 PM, Chris Bentzel <cbentzel@chromium.org> wrote:
>
> Actually, I'm less sure about putting Cancel and ChangePriority inside of
> Job as you'll need to map back to a handle object or other iterator. I do
> like the WeakPtr suggestion.
>

I was assuming the Job would hold a Handle to itself. In most cases, I
expect the users of PrioritizedDispatcher to do that anyway (see
HostResolverImpl::Job). This would also allow DispatchJob to
invalidate that handle which should make the API safer. In fact, we
could get make Handle private and just talk to the dispatcher via the
Job interface.

Powered by Google App Engine
This is Rietveld 408576698