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

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 1818603002: Keep track of ChannelIDService in CookieStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/url_request/url_request_context_builder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Value 3 was removed (CID_PERSISTENT_COOKIE_PERSISTENT) 77 // Value 3 was removed (CID_PERSISTENT_COOKIE_PERSISTENT)
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, 81 EPHEMERAL_MATCH = 7,
82 EPHEMERAL_MISMATCH = 8, 82 EPHEMERAL_MISMATCH = 8,
83 PERSISTENT_MATCH = 9, 83 PERSISTENT_MATCH = 9,
84 PERSISTENT_MISMATCH = 10, 84 PERSISTENT_MISMATCH = 10,
85 EPHEMERAL_UNKNOWN = 11,
86 PERSISTENT_UNKNOWN = 12,
85 EPHEMERALITY_MAX 87 EPHEMERALITY_MAX
86 } ephemerality; 88 } ephemerality;
87 const net::HttpNetworkSession::Params* params = 89 const net::HttpNetworkSession::Params* params =
88 context->GetNetworkSessionParams(); 90 context->GetNetworkSessionParams();
89 net::CookieStore* cookie_store = context->cookie_store(); 91 net::CookieStore* cookie_store = context->cookie_store();
90 if (params == nullptr || params->channel_id_service == nullptr) { 92 if (params == nullptr || params->channel_id_service == nullptr) {
91 ephemerality = NO_CHANNEL_ID_STORE; 93 ephemerality = NO_CHANNEL_ID_STORE;
92 } else if (cookie_store == nullptr) { 94 } else if (cookie_store == nullptr) {
93 ephemerality = NO_COOKIE_STORE; 95 ephemerality = NO_COOKIE_STORE;
94 } else if (params->channel_id_service->GetChannelIDStore()->IsEphemeral()) { 96 } else if (params->channel_id_service->GetChannelIDStore()->IsEphemeral()) {
95 if (cookie_store->IsEphemeral()) { 97 if (cookie_store->IsEphemeral()) {
96 if (context->channel_id_service() && 98 if (cookie_store->GetChannelIDServiceID() == -1) {
97 params->channel_id_service->GetUniqueID() == 99 ephemerality = EPHEMERAL_UNKNOWN;
98 context->channel_id_service()->GetUniqueID()) { 100 } else if (context->channel_id_service() &&
101 cookie_store->GetChannelIDServiceID() ==
102 context->channel_id_service()->GetUniqueID()) {
mmenke 2016/03/18 21:50:45 While I'm not familiar with just how channel ID is
nharper 2016/03/18 21:59:03 Safe browsing wires up its own CookieStore, but do
99 ephemerality = EPHEMERAL_MATCH; 103 ephemerality = EPHEMERAL_MATCH;
100 } else { 104 } else {
101 ephemerality = EPHEMERAL_MISMATCH; 105 ephemerality = EPHEMERAL_MISMATCH;
102 } 106 }
103 } else if (context->has_known_mismatched_cookie_store()) { 107 } else if (context->has_known_mismatched_cookie_store()) {
104 ephemerality = KNOWN_MISMATCH; 108 ephemerality = KNOWN_MISMATCH;
105 } else { 109 } else {
106 ephemerality = CID_EPHEMERAL_COOKIE_PERSISTENT; 110 ephemerality = CID_EPHEMERAL_COOKIE_PERSISTENT;
107 } 111 }
108 } else if (cookie_store->IsEphemeral()) { 112 } else if (cookie_store->IsEphemeral()) {
109 ephemerality = CID_PERSISTENT_COOKIE_EPHEMERAL; 113 ephemerality = CID_PERSISTENT_COOKIE_EPHEMERAL;
114 } else if (cookie_store->GetChannelIDServiceID() == -1) {
115 ephemerality = PERSISTENT_UNKNOWN;
110 } else if (context->channel_id_service() && 116 } else if (context->channel_id_service() &&
111 params->channel_id_service->GetUniqueID() == 117 cookie_store->GetChannelIDServiceID() ==
112 context->channel_id_service()->GetUniqueID()) { 118 context->channel_id_service()->GetUniqueID()) {
113 ephemerality = PERSISTENT_MATCH; 119 ephemerality = PERSISTENT_MATCH;
114 } else { 120 } else {
115 ephemerality = PERSISTENT_MISMATCH; 121 ephemerality = PERSISTENT_MISMATCH;
116 } 122 }
117 UMA_HISTOGRAM_ENUMERATION("Net.TokenBinding.StoreEphemerality", ephemerality, 123 UMA_HISTOGRAM_ENUMERATION("Net.TokenBinding.StoreEphemerality", ephemerality,
118 EPHEMERALITY_MAX); 124 EPHEMERALITY_MAX);
119 } 125 }
120 126
121 } // namespace 127 } // namespace
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 return override_response_headers_.get() ? 1607 return override_response_headers_.get() ?
1602 override_response_headers_.get() : 1608 override_response_headers_.get() :
1603 transaction_->GetResponseInfo()->headers.get(); 1609 transaction_->GetResponseInfo()->headers.get();
1604 } 1610 }
1605 1611
1606 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1612 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1607 awaiting_callback_ = false; 1613 awaiting_callback_ = false;
1608 } 1614 }
1609 1615
1610 } // namespace net 1616 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698