OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/certificate_transparency/log_proof_fetcher.h" | 5 #include "components/certificate_transparency/log_proof_fetcher.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 private: | 390 private: |
391 LogProofFetcher::ConsistencyProofFetchedCallback proof_fetched_; | 391 LogProofFetcher::ConsistencyProofFetchedCallback proof_fetched_; |
392 }; | 392 }; |
393 | 393 |
394 LogProofFetcher::LogProofFetcher(net::URLRequestContext* request_context) | 394 LogProofFetcher::LogProofFetcher(net::URLRequestContext* request_context) |
395 : request_context_(request_context), weak_factory_(this) { | 395 : request_context_(request_context), weak_factory_(this) { |
396 DCHECK(request_context); | 396 DCHECK(request_context); |
397 } | 397 } |
398 | 398 |
399 LogProofFetcher::~LogProofFetcher() { | 399 LogProofFetcher::~LogProofFetcher() { |
400 STLDeleteContainerPointers(inflight_fetches_.begin(), | 400 base::STLDeleteContainerPointers(inflight_fetches_.begin(), |
401 inflight_fetches_.end()); | 401 inflight_fetches_.end()); |
402 } | 402 } |
403 | 403 |
404 void LogProofFetcher::FetchSignedTreeHead( | 404 void LogProofFetcher::FetchSignedTreeHead( |
405 const GURL& base_log_url, | 405 const GURL& base_log_url, |
406 const std::string& log_id, | 406 const std::string& log_id, |
407 const SignedTreeHeadFetchedCallback& fetched_callback, | 407 const SignedTreeHeadFetchedCallback& fetched_callback, |
408 const FetchFailedCallback& failed_callback) { | 408 const FetchFailedCallback& failed_callback) { |
409 GURL request_url = base_log_url.Resolve("ct/v1/get-sth"); | 409 GURL request_url = base_log_url.Resolve("ct/v1/get-sth"); |
410 StartFetch(request_url, new GetSTHLogResponseHandler(log_id, fetched_callback, | 410 StartFetch(request_url, new GetSTHLogResponseHandler(log_id, fetched_callback, |
411 failed_callback)); | 411 failed_callback)); |
(...skipping 25 matching lines...) Expand all Loading... |
437 const base::Closure& requestor_callback) { | 437 const base::Closure& requestor_callback) { |
438 auto it = inflight_fetches_.find(log_handler); | 438 auto it = inflight_fetches_.find(log_handler); |
439 DCHECK(it != inflight_fetches_.end()); | 439 DCHECK(it != inflight_fetches_.end()); |
440 | 440 |
441 delete *it; | 441 delete *it; |
442 inflight_fetches_.erase(it); | 442 inflight_fetches_.erase(it); |
443 requestor_callback.Run(); | 443 requestor_callback.Run(); |
444 } | 444 } |
445 | 445 |
446 } // namespace certificate_transparency | 446 } // namespace certificate_transparency |
OLD | NEW |