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

Side by Side Diff: net/ssl/channel_id_service.h

Issue 1770983002: Add atomic sequence number to ChannelIDService and check that in URLRequestHttpJob logging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small fixes 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 | « no previous file | net/ssl/channel_id_service.cc » ('j') | net/url_request/url_request_http_job.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef NET_SSL_CHANNEL_ID_SERVICE_H_ 5 #ifndef NET_SSL_CHANNEL_ID_SERVICE_H_
6 #define NET_SSL_CHANNEL_ID_SERVICE_H_ 6 #define NET_SSL_CHANNEL_ID_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // 122 //
123 // |*out_req| will be initialized with a handle to the async request. 123 // |*out_req| will be initialized with a handle to the async request.
124 int GetChannelID(const std::string& host, 124 int GetChannelID(const std::string& host,
125 scoped_ptr<crypto::ECPrivateKey>* key, 125 scoped_ptr<crypto::ECPrivateKey>* key,
126 const CompletionCallback& callback, 126 const CompletionCallback& callback,
127 Request* out_req); 127 Request* out_req);
128 128
129 // Returns the backing ChannelIDStore. 129 // Returns the backing ChannelIDStore.
130 ChannelIDStore* GetChannelIDStore(); 130 ChannelIDStore* GetChannelIDStore();
131 131
132 // Returns an ID that is unique across all instances of ChannelIDService in
133 // this process. TODO(nharper): remove this once crbug.com/548423 is resolved.
134 int GetUniqueID() { return id_; }
mattm 2016/03/09 21:33:01 const method
nharper 2016/03/09 21:52:07 Done.
135
132 // Public only for unit testing. 136 // Public only for unit testing.
133 int channel_id_count(); 137 int channel_id_count();
134 uint64_t requests() const { return requests_; } 138 uint64_t requests() const { return requests_; }
135 uint64_t key_store_hits() const { return key_store_hits_; } 139 uint64_t key_store_hits() const { return key_store_hits_; }
136 uint64_t inflight_joins() const { return inflight_joins_; } 140 uint64_t inflight_joins() const { return inflight_joins_; }
137 uint64_t workers_created() const { return workers_created_; } 141 uint64_t workers_created() const { return workers_created_; }
138 142
139 private: 143 private:
140 void GotChannelID(int err, 144 void GotChannelID(int err,
141 const std::string& server_identifier, 145 const std::string& server_identifier,
(...skipping 22 matching lines...) Expand all
164 // failure (including failure to find a channel ID of |domain|). 168 // failure (including failure to find a channel ID of |domain|).
165 int LookupChannelID(const base::TimeTicks& request_start, 169 int LookupChannelID(const base::TimeTicks& request_start,
166 const std::string& domain, 170 const std::string& domain,
167 scoped_ptr<crypto::ECPrivateKey>* key, 171 scoped_ptr<crypto::ECPrivateKey>* key,
168 bool create_if_missing, 172 bool create_if_missing,
169 const CompletionCallback& callback, 173 const CompletionCallback& callback,
170 Request* out_req); 174 Request* out_req);
171 175
172 scoped_ptr<ChannelIDStore> channel_id_store_; 176 scoped_ptr<ChannelIDStore> channel_id_store_;
173 scoped_refptr<base::TaskRunner> task_runner_; 177 scoped_refptr<base::TaskRunner> task_runner_;
178 int id_;
mattm 2016/03/09 21:33:01 can this be const?
nharper 2016/03/09 21:52:07 Yes. Done.
174 179
175 // inflight_ maps from a server to an active generation which is taking 180 // inflight_ maps from a server to an active generation which is taking
176 // place. 181 // place.
177 std::map<std::string, ChannelIDServiceJob*> inflight_; 182 std::map<std::string, ChannelIDServiceJob*> inflight_;
178 183
179 uint64_t requests_; 184 uint64_t requests_;
180 uint64_t key_store_hits_; 185 uint64_t key_store_hits_;
181 uint64_t inflight_joins_; 186 uint64_t inflight_joins_;
182 uint64_t workers_created_; 187 uint64_t workers_created_;
183 188
184 base::WeakPtrFactory<ChannelIDService> weak_ptr_factory_; 189 base::WeakPtrFactory<ChannelIDService> weak_ptr_factory_;
185 190
186 DISALLOW_COPY_AND_ASSIGN(ChannelIDService); 191 DISALLOW_COPY_AND_ASSIGN(ChannelIDService);
187 }; 192 };
188 193
189 } // namespace net 194 } // namespace net
190 195
191 #endif // NET_SSL_CHANNEL_ID_SERVICE_H_ 196 #endif // NET_SSL_CHANNEL_ID_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | net/ssl/channel_id_service.cc » ('j') | net/url_request/url_request_http_job.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698