| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Both stores are ephemeral, but it was never recorded in the CookieStore | 117 // Both stores are ephemeral, but it was never recorded in the CookieStore |
| 118 // which ChannelIDService it was created for, so it is unknown whether the | 118 // which ChannelIDService it was created for, so it is unknown whether the |
| 119 // stores match. | 119 // stores match. |
| 120 EPHEMERAL_UNKNOWN = 11, | 120 EPHEMERAL_UNKNOWN = 11, |
| 121 // Both stores are persistent, but it was never recorded in the CookieStore | 121 // Both stores are persistent, but it was never recorded in the CookieStore |
| 122 // which ChannelIDService it was created for, so it is unknown whether the | 122 // which ChannelIDService it was created for, so it is unknown whether the |
| 123 // stores match. | 123 // stores match. |
| 124 PERSISTENT_UNKNOWN = 12, | 124 PERSISTENT_UNKNOWN = 12, |
| 125 EPHEMERALITY_MAX | 125 EPHEMERALITY_MAX |
| 126 } ephemerality; | 126 } ephemerality; |
| 127 const net::HttpNetworkSession::Params* params = | 127 const net::HttpNetworkSession::Context* session_context = |
| 128 context->GetNetworkSessionParams(); | 128 context->GetNetworkSessionContext(); |
| 129 net::CookieStore* cookie_store = context->cookie_store(); | 129 net::CookieStore* cookie_store = context->cookie_store(); |
| 130 if (params == nullptr || params->channel_id_service == nullptr) { | 130 if (session_context == nullptr || |
| 131 session_context->channel_id_service == nullptr) { |
| 131 ephemerality = NO_CHANNEL_ID_STORE; | 132 ephemerality = NO_CHANNEL_ID_STORE; |
| 132 } else if (cookie_store == nullptr) { | 133 } else if (cookie_store == nullptr) { |
| 133 ephemerality = NO_COOKIE_STORE; | 134 ephemerality = NO_COOKIE_STORE; |
| 134 } else if (params->channel_id_service->GetChannelIDStore()->IsEphemeral()) { | 135 } else if (session_context->channel_id_service->GetChannelIDStore() |
| 136 ->IsEphemeral()) { |
| 135 if (cookie_store->IsEphemeral()) { | 137 if (cookie_store->IsEphemeral()) { |
| 136 if (cookie_store->GetChannelIDServiceID() == -1) { | 138 if (cookie_store->GetChannelIDServiceID() == -1) { |
| 137 ephemerality = EPHEMERAL_UNKNOWN; | 139 ephemerality = EPHEMERAL_UNKNOWN; |
| 138 } else if (cookie_store->GetChannelIDServiceID() == | 140 } else if (cookie_store->GetChannelIDServiceID() == |
| 139 params->channel_id_service->GetUniqueID()) { | 141 session_context->channel_id_service->GetUniqueID()) { |
| 140 ephemerality = EPHEMERAL_MATCH; | 142 ephemerality = EPHEMERAL_MATCH; |
| 141 } else { | 143 } else { |
| 142 NOTREACHED(); | 144 NOTREACHED(); |
| 143 ephemerality = EPHEMERAL_MISMATCH; | 145 ephemerality = EPHEMERAL_MISMATCH; |
| 144 } | 146 } |
| 145 } else { | 147 } else { |
| 146 NOTREACHED(); | 148 NOTREACHED(); |
| 147 ephemerality = CID_EPHEMERAL_COOKIE_PERSISTENT; | 149 ephemerality = CID_EPHEMERAL_COOKIE_PERSISTENT; |
| 148 } | 150 } |
| 149 } else if (cookie_store->IsEphemeral()) { | 151 } else if (cookie_store->IsEphemeral()) { |
| 150 NOTREACHED(); | 152 NOTREACHED(); |
| 151 ephemerality = CID_PERSISTENT_COOKIE_EPHEMERAL; | 153 ephemerality = CID_PERSISTENT_COOKIE_EPHEMERAL; |
| 152 } else if (cookie_store->GetChannelIDServiceID() == -1) { | 154 } else if (cookie_store->GetChannelIDServiceID() == -1) { |
| 153 ephemerality = PERSISTENT_UNKNOWN; | 155 ephemerality = PERSISTENT_UNKNOWN; |
| 154 } else if (cookie_store->GetChannelIDServiceID() == | 156 } else if (cookie_store->GetChannelIDServiceID() == |
| 155 params->channel_id_service->GetUniqueID()) { | 157 session_context->channel_id_service->GetUniqueID()) { |
| 156 ephemerality = PERSISTENT_MATCH; | 158 ephemerality = PERSISTENT_MATCH; |
| 157 } else { | 159 } else { |
| 158 NOTREACHED(); | 160 NOTREACHED(); |
| 159 ephemerality = PERSISTENT_MISMATCH; | 161 ephemerality = PERSISTENT_MISMATCH; |
| 160 } | 162 } |
| 161 UMA_HISTOGRAM_ENUMERATION("Net.TokenBinding.StoreEphemerality", ephemerality, | 163 UMA_HISTOGRAM_ENUMERATION("Net.TokenBinding.StoreEphemerality", ephemerality, |
| 162 EPHEMERALITY_MAX); | 164 EPHEMERALITY_MAX); |
| 163 } | 165 } |
| 164 | 166 |
| 165 } // namespace | 167 } // namespace |
| (...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1574 awaiting_callback_ = false; | 1576 awaiting_callback_ = false; |
| 1575 | 1577 |
| 1576 // Notify NetworkQualityEstimator. | 1578 // Notify NetworkQualityEstimator. |
| 1577 NetworkQualityEstimator* network_quality_estimator = | 1579 NetworkQualityEstimator* network_quality_estimator = |
| 1578 request()->context()->network_quality_estimator(); | 1580 request()->context()->network_quality_estimator(); |
| 1579 if (network_quality_estimator) | 1581 if (network_quality_estimator) |
| 1580 network_quality_estimator->NotifyURLRequestDestroyed(*request()); | 1582 network_quality_estimator->NotifyURLRequestDestroyed(*request()); |
| 1581 } | 1583 } |
| 1582 | 1584 |
| 1583 } // namespace net | 1585 } // namespace net |
| OLD | NEW |