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

Issue 2116983002: Change HostResolver::Resolve() to take an std::unique_ptr<Request>* rather than a RequestHandle* (Closed)

Created:
4 years, 5 months ago by maksims (do not use this acc)
Modified:
3 years, 9 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, cbentzel+watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin (slow to review), extensions-reviews_chromium.org, oshima+watch_chromium.org, qsr+mojo_chromium.org, stevenjb+watch_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change HostResolver::Resolve() to take a std::unique_ptr<Request>* rather than a RequestHandle* This cl has the following changes: 1) New class HostResolver::Request: it contains all the necessary data for the actual request. 2) HostResolver::Resolve() takes an std::unique_ptr<Request>* rather than a RequestHandle* now. 3) HostResolver::CancelRequest() method is removed. If consumers want to cancel their requests, request.reset() should be called. BUG=486264 Committed: https://crrev.com/31452af8fb1192199be24016b3701feb09b31c2d Cr-Commit-Position: refs/heads/master@{#408062}

Patch Set 1 #

Total comments: 30

Patch Set 2 : changed implementation of attach/detach of request #

Total comments: 54

Patch Set 3 : mmenke's comments and rebasing #

Total comments: 14

Patch Set 4 : comments #

Patch Set 5 : rebased #

Patch Set 6 : http_stream_factory_impl_job_controller_unittest RequestHandle* to unique_ptr #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+464 lines, -460 lines) Patch
M chrome/browser/devtools/device/port_forwarding_controller.cc View 1 2 3 2 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/devtools/device/tcp_device_provider.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M chromeos/network/host_resolver_impl_chromeos.h View 1 chunk +1 line, -1 line 0 comments Download
M chromeos/network/host_resolver_impl_chromeos.cc View 1 chunk +1 line, -1 line 0 comments Download
M chromeos/network/host_resolver_impl_chromeos_unittest.cc View 1 2 3 2 chunks +4 lines, -7 lines 0 comments Download
M extensions/browser/api/dns/dns_api.h View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/api/dns/dns_api.cc View 1 2 3 2 chunks +3 lines, -9 lines 0 comments Download
M extensions/browser/api/socket/socket_api.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/browser/api/socket/socket_api.cc View 1 2 3 1 chunk +1 line, -4 lines 0 comments Download
M net/dns/host_resolver.h View 1 2 3 chunks +19 lines, -19 lines 0 comments Download
M net/dns/host_resolver.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M net/dns/host_resolver_impl.h View 2 chunks +2 lines, -5 lines 0 comments Download
M net/dns/host_resolver_impl.cc View 1 2 14 chunks +78 lines, -87 lines 0 comments Download
M net/dns/host_resolver_impl_fuzzer.cc View 1 2 5 chunks +6 lines, -10 lines 0 comments Download
M net/dns/host_resolver_impl_unittest.cc View 1 2 6 chunks +13 lines, -19 lines 0 comments Download
M net/dns/host_resolver_mojo.h View 1 1 chunk +2 lines, -4 lines 0 comments Download
M net/dns/host_resolver_mojo.cc View 1 2 6 chunks +23 lines, -17 lines 0 comments Download
M net/dns/host_resolver_mojo_unittest.cc View 1 5 chunks +32 lines, -35 lines 0 comments Download
M net/dns/mapped_host_resolver.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M net/dns/mapped_host_resolver.cc View 1 2 chunks +2 lines, -6 lines 0 comments Download
M net/dns/mapped_host_resolver_unittest.cc View 1 10 chunks +25 lines, -41 lines 0 comments Download
M net/dns/mock_host_resolver.h View 1 4 chunks +10 lines, -7 lines 0 comments Download
M net/dns/mock_host_resolver.cc View 1 2 7 chunks +59 lines, -37 lines 0 comments Download
M net/dns/mojo_host_resolver_impl.cc View 1 3 chunks +4 lines, -8 lines 0 comments Download
M net/dns/mojo_host_resolver_impl_unittest.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M net/dns/single_request_host_resolver.h View 1 chunk +1 line, -1 line 0 comments Download
M net/dns/single_request_host_resolver.cc View 1 2 5 chunks +6 lines, -10 lines 0 comments Download
M net/dns/single_request_host_resolver_unittest.cc View 1 2 3 chunks +25 lines, -7 lines 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 2 3 4 7 chunks +19 lines, -24 lines 0 comments Download
M net/http/http_stream_factory_impl_job_controller_unittest.cc View 1 2 3 4 5 2 chunks +2 lines, -4 lines 0 comments Download
M net/proxy/proxy_resolver_factory_mojo_unittest.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
M net/proxy/proxy_resolver_v8_tracing.cc View 1 2 6 chunks +6 lines, -10 lines 1 comment Download
M net/proxy/proxy_resolver_v8_tracing_unittest.cc View 1 2 4 chunks +20 lines, -6 lines 0 comments Download
M net/proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc View 1 2 4 chunks +20 lines, -6 lines 0 comments Download
M net/proxy/proxy_service_mojo_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M net/quic/quic_network_transaction_unittest.cc View 1 2 9 chunks +18 lines, -9 lines 0 comments Download
M net/socket/socks5_client_socket_unittest.cc View 1 2 1 chunk +4 lines, -6 lines 0 comments Download
M net/socket/socks_client_socket_unittest.cc View 1 2 2 chunks +22 lines, -9 lines 0 comments Download
M net/socket/ssl_client_socket_pool_unittest.cc View 1 4 chunks +7 lines, -12 lines 0 comments Download
M net/socket/transport_client_socket_unittest.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M net/spdy/spdy_session_pool_unittest.cc View 1 2 3 4 2 chunks +4 lines, -6 lines 0 comments Download
M net/spdy/spdy_session_unittest.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M net/test/spawned_test_server/base_test_server.cc View 1 2 3 4 1 chunk +3 lines, -6 lines 0 comments Download
M net/tools/gdig/gdig.cc View 1 2 3 2 chunks +2 lines, -5 lines 0 comments Download

Messages

Total messages: 120 (80 generated)
maksims (do not use this acc)
please take a look
4 years, 5 months ago (2016-07-05 11:21:08 UTC) #14
eroman
(Most of these US-based reviewers were out on vacation) Will try to get to this ...
4 years, 5 months ago (2016-07-06 20:08:05 UTC) #15
maksims (do not use this acc)
On 2016/07/06 20:08:05, eroman wrote: > (Most of these US-based reviewers were out on vacation) ...
4 years, 5 months ago (2016-07-07 05:08:12 UTC) #16
jam
which parts do you want me to look at?
4 years, 5 months ago (2016-07-09 02:28:01 UTC) #17
maksims (do not use this acc)
On 2016/07/09 02:28:01, jam wrote: > which parts do you want me to look at? ...
4 years, 5 months ago (2016-07-11 04:55:51 UTC) #18
eroman
jam@ isn't needed on this review, I suggest removing him. The majority of this CL ...
4 years, 5 months ago (2016-07-11 19:59:40 UTC) #19
maksims (do not use this acc)
On 2016/07/11 19:59:40, eroman wrote: > jam@ isn't needed on this review, I suggest removing ...
4 years, 5 months ago (2016-07-12 05:23:12 UTC) #21
Devlin
https://codereview.chromium.org/2116983002/diff/160001/extensions/browser/api/dns/dns_api.cc File extensions/browser/api/dns/dns_api.cc (right): https://codereview.chromium.org/2116983002/diff/160001/extensions/browser/api/dns/dns_api.cc#newcode28 extensions/browser/api/dns/dns_api.cc:28: request_handle_(nullptr), unnecessary (this is the default construction of std::unique_ptr) ...
4 years, 5 months ago (2016-07-12 15:04:51 UTC) #22
mmenke
https://codereview.chromium.org/2116983002/diff/160001/net/dns/host_resolver.h File net/dns/host_resolver.h (right): https://codereview.chromium.org/2116983002/diff/160001/net/dns/host_resolver.h#newcode45 net/dns/host_resolver.h:45: class NET_EXPORT Request { Document this class. (Owned by ...
4 years, 5 months ago (2016-07-12 18:50:24 UTC) #23
maksims (do not use this acc)
https://codereview.chromium.org/2116983002/diff/160001/net/dns/host_resolver_impl.cc File net/dns/host_resolver_impl.cc (right): https://codereview.chromium.org/2116983002/diff/160001/net/dns/host_resolver_impl.cc#newcode1419 net/dns/host_resolver_impl.cc:1419: return; // no request found, might have already been ...
4 years, 5 months ago (2016-07-13 11:40:27 UTC) #24
maksims (do not use this acc)
Matt, appreciate your help. It would be nice if you could explain me, what is ...
4 years, 5 months ago (2016-07-14 12:02:47 UTC) #25
mmenke
https://codereview.chromium.org/2116983002/diff/160001/extensions/browser/api/dns/dns_api.cc File extensions/browser/api/dns/dns_api.cc (right): https://codereview.chromium.org/2116983002/diff/160001/extensions/browser/api/dns/dns_api.cc#newcode91 extensions/browser/api/dns/dns_api.cc:91: // destructor is not called automatically. On 2016/07/14 12:02:47, ...
4 years, 5 months ago (2016-07-14 18:25:31 UTC) #26
maksims (do not use this acc)
dns_api and socket_api are fixed. No need to explicitly delete the request after a resolve ...
4 years, 5 months ago (2016-07-19 15:00:26 UTC) #41
mmenke
Wow! I did not realize how many mock implementations of HostResolver we had. https://codereview.chromium.org/2116983002/diff/240001/net/dns/host_resolver.h File ...
4 years, 5 months ago (2016-07-19 19:03:57 UTC) #42
maksims (do not use this acc)
https://codereview.chromium.org/2116983002/diff/240001/net/dns/host_resolver.h File net/dns/host_resolver.h (right): https://codereview.chromium.org/2116983002/diff/240001/net/dns/host_resolver.h#newcode55 net/dns/host_resolver.h:55: // completion callback has already run or the request ...
4 years, 5 months ago (2016-07-21 07:12:46 UTC) #65
mmenke
LGTM, modulo comments. https://codereview.chromium.org/2116983002/diff/340001/chrome/browser/devtools/device/port_forwarding_controller.cc File chrome/browser/devtools/device/port_forwarding_controller.cc (right): https://codereview.chromium.org/2116983002/diff/340001/chrome/browser/devtools/device/port_forwarding_controller.cc#newcode69 chrome/browser/devtools/device/port_forwarding_controller.cc:69: std::unique_ptr<net::HostResolver::Request> request; You don't need this ...
4 years, 5 months ago (2016-07-21 16:00:41 UTC) #68
mmenke
On 2016/07/21 16:00:41, mmenke wrote: > LGTM, modulo comments. (And, for the record, I double-checked ...
4 years, 5 months ago (2016-07-21 16:01:52 UTC) #69
maksims (do not use this acc)
Would you please take a look? I think I still need your approvals. cpu@: chrome/browser/devtools/device/port_forwarding_controller.cc ...
4 years, 5 months ago (2016-07-22 10:16:00 UTC) #72
maksims (do not use this acc)
Reminder: cpu@: chrome/browser/devtools/device/port_forwarding_controller.cc chrome/browser/devtools/device/tcp_device_provider.cc extensions/browser/api/dns/dns_api.cc extensions/browser/api/dns/dns_api.h extensions/browser/api/socket/socket_api.cc extensions/browser/api/socket/socket_api.h gauravsh@: chromeos/network/host_resolver_impl_chromeos.cc chromeos/network/host_resolver_impl_chromeos.h chromeos/network/host_resolver_impl_chromeos_unittest.cc
4 years, 5 months ago (2016-07-25 05:02:40 UTC) #80
gauravsh
maksims: Sorry, I just saw this. For chromeos/network, you should get an OWNERS approval from ...
4 years, 5 months ago (2016-07-25 17:01:07 UTC) #81
gauravsh
maksims: Sorry, I just saw this. For chromeos/network, you should get an OWNERS approval from ...
4 years, 5 months ago (2016-07-25 17:01:09 UTC) #82
stevenjb
chromeos/ RS LGTM
4 years, 5 months ago (2016-07-25 17:15:56 UTC) #84
mmenke
On 2016/07/25 05:02:40, maksims wrote: > Reminder: > > cpu@: > chrome/browser/devtools/device/port_forwarding_controller.cc > chrome/browser/devtools/device/tcp_device_provider.cc > ...
4 years, 5 months ago (2016-07-25 21:10:44 UTC) #85
maksims (do not use this acc)
brettw@ or jam@, would you please review the following: > chrome/browser/devtools/device/port_forwarding_controller.cc > chrome/browser/devtools/device/tcp_device_provider.cc > extensions/browser/api/dns/dns_api.cc ...
4 years, 4 months ago (2016-07-26 04:48:25 UTC) #87
mmenke
On 2016/07/26 04:48:25, maksims wrote: > brettw@ or jam@, would you please review the following: ...
4 years, 4 months ago (2016-07-26 11:49:52 UTC) #88
maksims (do not use this acc)
On 2016/07/26 11:49:52, mmenke wrote: > On 2016/07/26 04:48:25, maksims wrote: > > brettw@ or ...
4 years, 4 months ago (2016-07-26 20:16:53 UTC) #90
dgozman
devtools lgtm
4 years, 4 months ago (2016-07-26 20:28:16 UTC) #91
Marijn Kruisselbrink
extensions lgtm
4 years, 4 months ago (2016-07-26 20:43:51 UTC) #92
maksims (do not use this acc)
Thanks!
4 years, 4 months ago (2016-07-26 20:44:36 UTC) #93
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/2116983002/380001
4 years, 4 months ago (2016-07-26 20:45:30 UTC) #96
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/41752) ios-simulator-gn on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 4 months ago (2016-07-26 20:53:42 UTC) #98
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/2116983002/400001
4 years, 4 months ago (2016-07-27 04:48:23 UTC) #102
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/42021)
4 years, 4 months ago (2016-07-27 04:56:50 UTC) #104
maksims (do not use this acc)
On 2016/07/26 11:49:52, mmenke wrote: > On 2016/07/26 04:48:25, maksims wrote: > > brettw@ or ...
4 years, 4 months ago (2016-07-27 05:02:08 UTC) #105
maksims (do not use this acc)
> Seems like somebody has written some new code while this cl has been under ...
4 years, 4 months ago (2016-07-27 05:02:46 UTC) #106
mmenke
On 2016/07/27 05:02:46, maksims wrote: > > Seems like somebody has written some new code ...
4 years, 4 months ago (2016-07-27 05:23:31 UTC) #109
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/2116983002/420001
4 years, 4 months ago (2016-07-27 06:34:01 UTC) #114
commit-bot: I haz the power
Committed patchset #6 (id:420001)
4 years, 4 months ago (2016-07-27 06:38:27 UTC) #116
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/31452af8fb1192199be24016b3701feb09b31c2d Cr-Commit-Position: refs/heads/master@{#408062}
4 years, 4 months ago (2016-07-27 06:40:47 UTC) #118
jochen (gone - plz use gerrit)
3 years, 9 months ago (2017-03-08 15:22:10 UTC) #120
Message was sent while issue was closed.
https://codereview.chromium.org/2116983002/diff/420001/net/proxy/proxy_resolv...
File net/proxy/proxy_resolver_v8_tracing.cc (right):

https://codereview.chromium.org/2116983002/diff/420001/net/proxy/proxy_resolv...
net/proxy/proxy_resolver_v8_tracing.cc:287:
std::unique_ptr<HostResolver::Request> pending_dns_;
std::unique_ptr cannot be read atomically, and given that we read it lock-less
from workers while writing (in Job::Cancel) from the foreground thread, this now
introduces a data race

Powered by Google App Engine
This is Rietveld 408576698