OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 | 67 |
68 void LogChannelIDAndCookieStores(const net::URLRequestContext* context, | 68 void LogChannelIDAndCookieStores(const net::URLRequestContext* context, |
69 const net::SSLInfo& ssl_info) { | 69 const net::SSLInfo& ssl_info) { |
70 if (!ssl_info.channel_id_sent) | 70 if (!ssl_info.channel_id_sent) |
71 return; | 71 return; |
72 // This enum is used for an UMA histogram - don't reuse or renumber entries. | 72 // This enum is used for an UMA histogram - don't reuse or renumber entries. |
73 enum { | 73 enum { |
74 CID_EPHEMERAL_COOKIE_EPHEMERAL = 0, | 74 CID_EPHEMERAL_COOKIE_EPHEMERAL = 0, |
75 CID_EPHEMERAL_COOKIE_PERSISTENT = 1, | 75 CID_EPHEMERAL_COOKIE_PERSISTENT = 1, |
76 CID_PERSISTENT_COOKIE_EPHEMERAL = 2, | 76 CID_PERSISTENT_COOKIE_EPHEMERAL = 2, |
77 CID_PERSISTENT_COOKIE_PERSISTENT = 3, | 77 CID_PERSISTENT_COOKIE_PERSISTENT = 3, |
mattm
2016/03/09 21:33:01
Comment out which of these are no longer used
nharper
2016/03/09 21:52:07
Done.
| |
78 NO_COOKIE_STORE = 4, | 78 NO_COOKIE_STORE = 4, |
79 NO_CHANNEL_ID_STORE = 5, | 79 NO_CHANNEL_ID_STORE = 5, |
80 KNOWN_MISMATCH = 6, | 80 KNOWN_MISMATCH = 6, |
81 EPHEMERAL_MATCH = 7, | |
82 EPHEMERAL_MISMATCH = 8, | |
83 PERSISTENT_MATCH = 9, | |
84 PERSISTENT_MISMATCH = 10, | |
81 EPHEMERALITY_MAX | 85 EPHEMERALITY_MAX |
82 } ephemerality; | 86 } ephemerality; |
83 const net::HttpNetworkSession::Params* params = | 87 const net::HttpNetworkSession::Params* params = |
84 context->GetNetworkSessionParams(); | 88 context->GetNetworkSessionParams(); |
85 net::CookieStore* cookie_store = context->cookie_store(); | 89 net::CookieStore* cookie_store = context->cookie_store(); |
86 if (params == nullptr || params->channel_id_service == nullptr) { | 90 if (params == nullptr || params->channel_id_service == nullptr) { |
87 ephemerality = NO_CHANNEL_ID_STORE; | 91 ephemerality = NO_CHANNEL_ID_STORE; |
88 } else if (cookie_store == nullptr) { | 92 } else if (cookie_store == nullptr) { |
89 ephemerality = NO_COOKIE_STORE; | 93 ephemerality = NO_COOKIE_STORE; |
90 } else if (params->channel_id_service->GetChannelIDStore()->IsEphemeral()) { | 94 } else if (params->channel_id_service->GetChannelIDStore()->IsEphemeral()) { |
91 if (cookie_store->IsEphemeral()) { | 95 if (cookie_store->IsEphemeral()) { |
92 ephemerality = CID_EPHEMERAL_COOKIE_EPHEMERAL; | 96 if (context->channel_id_service() && |
97 params->channel_id_service->GetUniqueID() == | |
98 context->channel_id_service()->GetUniqueID()) { | |
99 ephemerality = EPHEMERAL_MATCH; | |
100 } else { | |
101 ephemerality = EPHEMERAL_MISMATCH; | |
102 } | |
93 } else if (context->has_known_mismatched_cookie_store()) { | 103 } else if (context->has_known_mismatched_cookie_store()) { |
94 ephemerality = KNOWN_MISMATCH; | 104 ephemerality = KNOWN_MISMATCH; |
95 } else { | 105 } else { |
96 ephemerality = CID_EPHEMERAL_COOKIE_PERSISTENT; | 106 ephemerality = CID_EPHEMERAL_COOKIE_PERSISTENT; |
97 } | 107 } |
98 } else if (cookie_store->IsEphemeral()) { | 108 } else if (!cookie_store->IsEphemeral()) { |
99 ephemerality = CID_PERSISTENT_COOKIE_EPHEMERAL; | 109 ephemerality = CID_PERSISTENT_COOKIE_PERSISTENT; |
mattm
2016/03/09 21:33:01
this looks wrong..
Above,CID_EPHEMERAL_COOKIE_EPH
nharper
2016/03/09 21:52:07
I goofed when making this half of the change. Your
| |
110 } else if (context->channel_id_service() && | |
111 params->channel_id_service->GetUniqueID() == | |
112 context->channel_id_service()->GetUniqueID()) { | |
113 ephemerality = PERSISTENT_MATCH; | |
100 } else { | 114 } else { |
101 ephemerality = CID_PERSISTENT_COOKIE_PERSISTENT; | 115 ephemerality = PERSISTENT_MISMATCH; |
102 } | 116 } |
103 UMA_HISTOGRAM_ENUMERATION("Net.TokenBinding.StoreEphemerality", ephemerality, | 117 UMA_HISTOGRAM_ENUMERATION("Net.TokenBinding.StoreEphemerality", ephemerality, |
104 EPHEMERALITY_MAX); | 118 EPHEMERALITY_MAX); |
105 } | 119 } |
106 | 120 |
107 } // namespace | 121 } // namespace |
108 | 122 |
109 namespace net { | 123 namespace net { |
110 | 124 |
111 class URLRequestHttpJob::HttpFilterContext : public FilterContext { | 125 class URLRequestHttpJob::HttpFilterContext : public FilterContext { |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1564 return override_response_headers_.get() ? | 1578 return override_response_headers_.get() ? |
1565 override_response_headers_.get() : | 1579 override_response_headers_.get() : |
1566 transaction_->GetResponseInfo()->headers.get(); | 1580 transaction_->GetResponseInfo()->headers.get(); |
1567 } | 1581 } |
1568 | 1582 |
1569 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1583 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1570 awaiting_callback_ = false; | 1584 awaiting_callback_ = false; |
1571 } | 1585 } |
1572 | 1586 |
1573 } // namespace net | 1587 } // namespace net |
OLD | NEW |