| OLD | NEW |
| 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 #include "net/ssl/channel_id_service.h" | 5 #include "net/ssl/channel_id_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 if (domain.empty()) | 296 if (domain.empty()) |
| 297 return host; | 297 return host; |
| 298 return domain; | 298 return domain; |
| 299 } | 299 } |
| 300 | 300 |
| 301 int ChannelIDService::GetOrCreateChannelID( | 301 int ChannelIDService::GetOrCreateChannelID( |
| 302 const std::string& host, | 302 const std::string& host, |
| 303 std::unique_ptr<crypto::ECPrivateKey>* key, | 303 std::unique_ptr<crypto::ECPrivateKey>* key, |
| 304 const CompletionCallback& callback, | 304 const CompletionCallback& callback, |
| 305 Request* out_req) { | 305 Request* out_req) { |
| 306 DVLOG(1) << __FUNCTION__ << " " << host; | 306 DVLOG(1) << __func__ << " " << host; |
| 307 DCHECK(CalledOnValidThread()); | 307 DCHECK(CalledOnValidThread()); |
| 308 base::TimeTicks request_start = base::TimeTicks::Now(); | 308 base::TimeTicks request_start = base::TimeTicks::Now(); |
| 309 | 309 |
| 310 if (callback.is_null() || !key || host.empty()) { | 310 if (callback.is_null() || !key || host.empty()) { |
| 311 RecordGetChannelIDResult(INVALID_ARGUMENT); | 311 RecordGetChannelIDResult(INVALID_ARGUMENT); |
| 312 return ERR_INVALID_ARGUMENT; | 312 return ERR_INVALID_ARGUMENT; |
| 313 } | 313 } |
| 314 | 314 |
| 315 std::string domain = GetDomainForHost(host); | 315 std::string domain = GetDomainForHost(host); |
| 316 if (domain.empty()) { | 316 if (domain.empty()) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 return ERR_IO_PENDING; | 351 return ERR_IO_PENDING; |
| 352 } | 352 } |
| 353 | 353 |
| 354 return err; | 354 return err; |
| 355 } | 355 } |
| 356 | 356 |
| 357 int ChannelIDService::GetChannelID(const std::string& host, | 357 int ChannelIDService::GetChannelID(const std::string& host, |
| 358 std::unique_ptr<crypto::ECPrivateKey>* key, | 358 std::unique_ptr<crypto::ECPrivateKey>* key, |
| 359 const CompletionCallback& callback, | 359 const CompletionCallback& callback, |
| 360 Request* out_req) { | 360 Request* out_req) { |
| 361 DVLOG(1) << __FUNCTION__ << " " << host; | 361 DVLOG(1) << __func__ << " " << host; |
| 362 DCHECK(CalledOnValidThread()); | 362 DCHECK(CalledOnValidThread()); |
| 363 base::TimeTicks request_start = base::TimeTicks::Now(); | 363 base::TimeTicks request_start = base::TimeTicks::Now(); |
| 364 | 364 |
| 365 if (callback.is_null() || !key || host.empty()) { | 365 if (callback.is_null() || !key || host.empty()) { |
| 366 RecordGetChannelIDResult(INVALID_ARGUMENT); | 366 RecordGetChannelIDResult(INVALID_ARGUMENT); |
| 367 return ERR_INVALID_ARGUMENT; | 367 return ERR_INVALID_ARGUMENT; |
| 368 } | 368 } |
| 369 | 369 |
| 370 std::string domain = GetDomainForHost(host); | 370 std::string domain = GetDomainForHost(host); |
| 371 if (domain.empty()) { | 371 if (domain.empty()) { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 } | 521 } |
| 522 | 522 |
| 523 return err; | 523 return err; |
| 524 } | 524 } |
| 525 | 525 |
| 526 int ChannelIDService::channel_id_count() { | 526 int ChannelIDService::channel_id_count() { |
| 527 return channel_id_store_->GetChannelIDCount(); | 527 return channel_id_store_->GetChannelIDCount(); |
| 528 } | 528 } |
| 529 | 529 |
| 530 } // namespace net | 530 } // namespace net |
| OLD | NEW |