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

Issue 1824903002: Change the AlternativeServiceMap with SchemeOriginPair key. (Closed)

Created:
4 years, 9 months ago by Zhongyi Shi
Modified:
4 years, 8 months ago
Reviewers:
CC:
chromium-reviews, loading-reviews_chromium.org, darin-cc_chromium.org, cbentzel+watch_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change the AlternativeServiceMap with SchemeOriginPair key. No behavior change. BUG=595938

Patch Set 1 #

Patch Set 2 : Change SupportsSpdy back #

Patch Set 3 : Add unittests #

Total comments: 21

Patch Set 4 : sync #

Patch Set 5 : address rch's comments #

Patch Set 6 : ignore old disk data when AddServersData #

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+576 lines, -371 lines) Patch
M content/browser/loader/resource_scheduler.cc View 1 2 3 4 2 chunks +6 lines, -4 lines 0 comments Download
M content/browser/loader/resource_scheduler_unittest.cc View 1 2 3 4 4 chunks +4 lines, -4 lines 0 comments Download
M net/base/host_port_pair.h View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M net/base/host_port_pair.cc View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M net/http/bidirectional_stream.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M net/http/bidirectional_stream_unittest.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M net/http/http_network_transaction.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 2 3 4 32 chunks +56 lines, -48 lines 0 comments Download
M net/http/http_server_properties.h View 1 2 3 4 6 chunks +7 lines, -6 lines 0 comments Download
M net/http/http_server_properties_impl.h View 1 2 3 4 5 chunks +10 lines, -9 lines 0 comments Download
M net/http/http_server_properties_impl.cc View 1 2 3 4 5 6 12 chunks +51 lines, -43 lines 0 comments Download
M net/http/http_server_properties_impl_unittest.cc View 1 2 3 4 36 chunks +200 lines, -144 lines 0 comments Download
M net/http/http_server_properties_manager.h View 1 2 3 4 5 6 5 chunks +8 lines, -7 lines 0 comments Download
M net/http/http_server_properties_manager.cc View 1 2 3 4 5 6 12 chunks +29 lines, -17 lines 0 comments Download
M net/http/http_server_properties_manager_unittest.cc View 1 2 3 4 5 19 chunks +69 lines, -56 lines 0 comments Download
M net/http/http_stream_factory.h View 1 2 3 4 2 chunks +6 lines, -5 lines 0 comments Download
M net/http/http_stream_factory.cc View 1 2 3 4 4 chunks +14 lines, -6 lines 0 comments Download
M net/http/http_stream_factory_impl.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M net/http/http_stream_factory_impl_job.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M net/http/http_stream_factory_impl_unittest.cc View 1 2 3 4 4 chunks +14 lines, -4 lines 0 comments Download
M net/quic/quic_network_transaction_unittest.cc View 1 2 3 4 4 chunks +74 lines, -7 lines 0 comments Download
M net/quic/quic_stream_factory.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M net/quic/quic_stream_factory_test.cc View 1 2 3 4 2 chunks +6 lines, -2 lines 0 comments Download
M net/spdy/spdy_network_transaction_unittest.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 10 (7 generated)
Zhongyi Shi
This cl still uses newly defined SchemeOriginPair. But it should be fine to use the ...
4 years, 9 months ago (2016-03-22 20:49:08 UTC) #4
Ryan Hamilton
Looking pretty good. I think there are a few more places where we should use ...
4 years, 9 months ago (2016-03-24 22:23:14 UTC) #5
Zhongyi Shi
4 years, 8 months ago (2016-04-04 18:58:36 UTC) #8
I will build another CL which updates disk data depending on this CL since we
need part of this CL's changes in that one.

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
File net/http/http_server_properties.h (right):

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties.h:210: class NET_EXPORT SchemeOriginPair {
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> I think we should definitely use url::SchemeHostPort unless there is some
reason
> that doesn't work.

Done.

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties.h:288: virtual bool GetSupportsSpdy(const
HostPortPair& server) = 0;
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> Should these next 6 methods also use a SHP?

I don't think so, only SupportsRequestPriority queries the Alt-Svc map and the
other methods doesn't refer to that map.

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
File net/http/http_server_properties_impl.cc (right):

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties_impl.cc:117: "https",
canonical_host_to_origin_map_[canonical_host])) !=
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> If we want canoncical suffixes to only apply to HTTPS (which seems reasonable)
> it'd be good to add a comment to that effect. Should also remove port 80 on
line
> 109 (and avoid the loop).

Done.

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties_impl.cc:351: if (origin.scheme() == "https" &&
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> I don't understand this check. Can you say more?

I thought we want to check whether the alt-svc is equivalent to origin. But, I
think you're right, we are actually checking whether there's a job already
running. So no need to check the origin's scheme.

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties_impl.cc:368: if (origin.scheme() != "https")
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> Comments.
Changing the CanonicalHostMap to be <SHP, SHP>, no need to check origin's scheme
anymore :D

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties_impl.cc:377: SchemeOriginPair("https",
canonical->second));
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> can you use origin.scheme() instead?

Acknowledged.

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties_impl.cc:463: if (origin.scheme() == "https" &&
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> comments.

Done.

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties_impl.cc:532: if (origin.scheme() == "https")
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> comments.

Acknowledged.

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
File net/http/http_server_properties_impl.h (right):

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties_impl.h:181: // actual origin, which has a
plausible alternate protocol mapping.
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> It seems like the key should really be a scheme/host/port now that we're doing
> that instead of host/port.

Done.

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
File net/http/http_server_properties_manager.cc (right):

https://codereview.chromium.org/1824903002/diff/60001/net/http/http_server_pr...
net/http/http_server_properties_manager.cc:563: SchemeOriginPair
scheme_origin_pair("https", server);
On 2016/03/24 22:23:14, Ryan Hamilton wrote:
> On 2016/03/22 20:49:08, Zhongyi Shi wrote:
> > I'm not sure, whether setting the scheme to be "https" is safe here. Or do
we
> > need the info from callers? 
> 
> I recommend chatting with Raman about this. He's the expert at the
serialization
> layer and has done this kind of change before.

After chatting with Raman and a deep digging in the code, found a lot more
changes to persist disk data. We need to change all the keys from HostPortPair
to SchemeHostPort, now seperate code to new dependent CL.

Powered by Google App Engine
This is Rietveld 408576698