Skip to content

Commit

Permalink
SignedExchangeCertFetcher: Remove |version| arg
Browse files Browse the repository at this point in the history
Bug: 919414

Change-Id: I1753f02c791784b152153835fc2a8add260c035c
Reviewed-on: https://chromium-review.googlesource.com/c/1425700
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Rob Buis <rbuis@igalia.com>
Cr-Commit-Position: refs/heads/master@{#624739}
  • Loading branch information
rwlbuis authored and Commit Bot committed Jan 22, 2019
1 parent f80ffb8 commit accda06
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 16 deletions.
7 changes: 2 additions & 5 deletions content/browser/web_package/signed_exchange_cert_fetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ SignedExchangeCertFetcher::CreateAndStart(
const GURL& cert_url,
url::Origin request_initiator,
bool force_fetch,
SignedExchangeVersion version,
CertificateCallback callback,
SignedExchangeDevToolsProxy* devtools_proxy,
const base::Optional<base::UnguessableToken>& throttling_profile_id) {
Expand All @@ -83,8 +82,8 @@ SignedExchangeCertFetcher::CreateAndStart(
std::unique_ptr<SignedExchangeCertFetcher> cert_fetcher(
new SignedExchangeCertFetcher(
std::move(shared_url_loader_factory), std::move(throttles), cert_url,
std::move(request_initiator), force_fetch, version,
std::move(callback), devtools_proxy, throttling_profile_id));
std::move(request_initiator), force_fetch, std::move(callback),
devtools_proxy, throttling_profile_id));
cert_fetcher->Start();
return cert_fetcher;
}
Expand All @@ -96,14 +95,12 @@ SignedExchangeCertFetcher::SignedExchangeCertFetcher(
const GURL& cert_url,
url::Origin request_initiator,
bool force_fetch,
SignedExchangeVersion version,
CertificateCallback callback,
SignedExchangeDevToolsProxy* devtools_proxy,
const base::Optional<base::UnguessableToken>& throttling_profile_id)
: shared_url_loader_factory_(std::move(shared_url_loader_factory)),
throttles_(std::move(throttles)),
resource_request_(std::make_unique<network::ResourceRequest>()),
version_(version),
callback_(std::move(callback)),
devtools_proxy_(devtools_proxy) {
// TODO(https://crbug.com/803774): Revisit more ResourceRequest flags.
Expand Down
3 changes: 0 additions & 3 deletions content/browser/web_package/signed_exchange_cert_fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class CONTENT_EXPORT SignedExchangeCertFetcher
const GURL& cert_url,
url::Origin request_initiator,
bool force_fetch,
SignedExchangeVersion version,
CertificateCallback callback,
SignedExchangeDevToolsProxy* devtools_proxy,
const base::Optional<base::UnguessableToken>& throttling_profile_id);
Expand All @@ -77,7 +76,6 @@ class CONTENT_EXPORT SignedExchangeCertFetcher
const GURL& cert_url,
url::Origin request_initiator,
bool force_fetch,
SignedExchangeVersion version,
CertificateCallback callback,
SignedExchangeDevToolsProxy* devtools_proxy,
const base::Optional<base::UnguessableToken>& throttling_profile_id);
Expand All @@ -102,7 +100,6 @@ class CONTENT_EXPORT SignedExchangeCertFetcher
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_;
std::vector<std::unique_ptr<URLLoaderThrottle>> throttles_;
std::unique_ptr<network::ResourceRequest> resource_request_;
const SignedExchangeVersion version_;
CertificateCallback callback_;

std::unique_ptr<ThrottlingURLLoader> url_loader_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class SignedExchangeCertFetcherFactoryImpl
std::unique_ptr<SignedExchangeCertFetcher> CreateFetcherAndStart(
const GURL& cert_url,
bool force_fetch,
SignedExchangeVersion version,
SignedExchangeCertFetcher::CertificateCallback callback,
SignedExchangeDevToolsProxy* devtools_proxy) override;

Expand All @@ -43,7 +42,6 @@ std::unique_ptr<SignedExchangeCertFetcher>
SignedExchangeCertFetcherFactoryImpl::CreateFetcherAndStart(
const GURL& cert_url,
bool force_fetch,
SignedExchangeVersion version,
SignedExchangeCertFetcher::CertificateCallback callback,
SignedExchangeDevToolsProxy* devtools_proxy) {
DCHECK(url_loader_factory_);
Expand All @@ -52,7 +50,7 @@ SignedExchangeCertFetcherFactoryImpl::CreateFetcherAndStart(
std::move(url_loader_throttles_getter_).Run();
return SignedExchangeCertFetcher::CreateAndStart(
std::move(url_loader_factory_), std::move(throttles), cert_url,
std::move(request_initiator_), force_fetch, version, std::move(callback),
std::move(request_initiator_), force_fetch, std::move(callback),
devtools_proxy, throttling_profile_id_);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class CONTENT_EXPORT SignedExchangeCertFetcherFactory {
virtual std::unique_ptr<SignedExchangeCertFetcher> CreateFetcherAndStart(
const GURL& cert_url,
bool force_fetch,
SignedExchangeVersion version,
SignedExchangeCertFetcher::CertificateCallback callback,
SignedExchangeDevToolsProxy* devtools_proxy) = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ class SignedExchangeCertFetcherTest : public testing::Test {
base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>(
&mock_loader_factory_),
std::move(throttles_), url, request_initiator_, force_fetch,
SignedExchangeVersion::kB2, std::move(callback),
nullptr /* devtools_proxy */,
std::move(callback), nullptr /* devtools_proxy */,
base::nullopt /* throttling_profile_id */);
}

Expand Down
2 changes: 1 addition & 1 deletion content/browser/web_package/signed_exchange_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ SignedExchangeHandler::ParseHeadersAndFetchCertificate() {
cert_fetch_start_time_ = base::TimeTicks::Now();
cert_fetcher_ = std::move(cert_fetcher_factory_)
->CreateFetcherAndStart(
cert_url, force_fetch, *version_,
cert_url, force_fetch,
base::BindOnce(&SignedExchangeHandler::OnCertReceived,
base::Unretained(this)),
devtools_proxy_.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class MockSignedExchangeCertFetcherFactory
std::unique_ptr<SignedExchangeCertFetcher> CreateFetcherAndStart(
const GURL& cert_url,
bool force_fetch,
SignedExchangeVersion version,
SignedExchangeCertFetcher::CertificateCallback callback,
SignedExchangeDevToolsProxy* devtools_proxy) override {
EXPECT_EQ(cert_url, expected_cert_url_);
Expand Down

0 comments on commit accda06

Please sign in to comment.