| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/safe_browsing_db/v4_update_protocol_manager.h" | 5 #include "components/safe_browsing_db/v4_update_protocol_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base64url.h" | 9 #include "base/base64url.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 GURL update_url; | 283 GURL update_url; |
| 284 net::HttpRequestHeaders headers; | 284 net::HttpRequestHeaders headers; |
| 285 GetUpdateUrlAndHeaders(req_base64, &update_url, &headers); | 285 GetUpdateUrlAndHeaders(req_base64, &update_url, &headers); |
| 286 | 286 |
| 287 std::unique_ptr<net::URLFetcher> fetcher = net::URLFetcher::Create( | 287 std::unique_ptr<net::URLFetcher> fetcher = net::URLFetcher::Create( |
| 288 url_fetcher_id_++, update_url, net::URLFetcher::GET, this); | 288 url_fetcher_id_++, update_url, net::URLFetcher::GET, this); |
| 289 fetcher->SetExtraRequestHeaders(headers.ToString()); | 289 fetcher->SetExtraRequestHeaders(headers.ToString()); |
| 290 data_use_measurement::DataUseUserData::AttachToFetcher( | 290 data_use_measurement::DataUseUserData::AttachToFetcher( |
| 291 fetcher.get(), data_use_measurement::DataUseUserData::SAFE_BROWSING); | 291 fetcher.get(), data_use_measurement::DataUseUserData::SAFE_BROWSING); |
| 292 | 292 |
| 293 request_.reset(fetcher.release()); | 293 request_ = std::move(fetcher); |
| 294 | 294 |
| 295 request_->SetLoadFlags(net::LOAD_DISABLE_CACHE); | 295 request_->SetLoadFlags(net::LOAD_DISABLE_CACHE); |
| 296 request_->SetRequestContext(request_context_getter_.get()); | 296 request_->SetRequestContext(request_context_getter_.get()); |
| 297 request_->Start(); | 297 request_->Start(); |
| 298 | 298 |
| 299 // Begin the update request timeout. | 299 // Begin the update request timeout. |
| 300 timeout_timer_.Start(FROM_HERE, | 300 timeout_timer_.Start(FROM_HERE, |
| 301 TimeDelta::FromSeconds(kV4TimerUpdateWaitSecMax), this, | 301 TimeDelta::FromSeconds(kV4TimerUpdateWaitSecMax), this, |
| 302 &V4UpdateProtocolManager::HandleTimeout); | 302 &V4UpdateProtocolManager::HandleTimeout); |
| 303 } | 303 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 365 |
| 366 void V4UpdateProtocolManager::GetUpdateUrlAndHeaders( | 366 void V4UpdateProtocolManager::GetUpdateUrlAndHeaders( |
| 367 const std::string& req_base64, | 367 const std::string& req_base64, |
| 368 GURL* gurl, | 368 GURL* gurl, |
| 369 net::HttpRequestHeaders* headers) const { | 369 net::HttpRequestHeaders* headers) const { |
| 370 V4ProtocolManagerUtil::GetRequestUrlAndHeaders( | 370 V4ProtocolManagerUtil::GetRequestUrlAndHeaders( |
| 371 req_base64, "threatListUpdates:fetch", config_, gurl, headers); | 371 req_base64, "threatListUpdates:fetch", config_, gurl, headers); |
| 372 } | 372 } |
| 373 | 373 |
| 374 } // namespace safe_browsing | 374 } // namespace safe_browsing |
| OLD | NEW |