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 "chrome/browser/safe_browsing/srt_fetcher_win.h" | 5 #include "chrome/browser/safe_browsing/srt_fetcher_win.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 public: | 248 public: |
249 explicit SRTFetcher(Profile* profile) | 249 explicit SRTFetcher(Profile* profile) |
250 : profile_(profile), | 250 : profile_(profile), |
251 url_fetcher_(net::URLFetcher::Create(0, | 251 url_fetcher_(net::URLFetcher::Create(0, |
252 GURL(GetSRTDownloadURL()), | 252 GURL(GetSRTDownloadURL()), |
253 net::URLFetcher::GET, | 253 net::URLFetcher::GET, |
254 this)) { | 254 this)) { |
255 url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE); | 255 url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE); |
256 url_fetcher_->SetMaxRetriesOn5xx(3); | 256 url_fetcher_->SetMaxRetriesOn5xx(3); |
257 url_fetcher_->SaveResponseToTemporaryFile( | 257 url_fetcher_->SaveResponseToTemporaryFile( |
258 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); | 258 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); |
259 url_fetcher_->SetRequestContext( | 259 url_fetcher_->SetRequestContext( |
260 g_browser_process->system_request_context()); | 260 g_browser_process->system_request_context()); |
261 // Adds the UMA bit to the download request if the user is enrolled in UMA. | 261 // Adds the UMA bit to the download request if the user is enrolled in UMA. |
262 ProfileIOData* io_data = ProfileIOData::FromResourceContext( | 262 ProfileIOData* io_data = ProfileIOData::FromResourceContext( |
263 profile_->GetResourceContext()); | 263 profile_->GetResourceContext()); |
264 net::HttpRequestHeaders headers; | 264 net::HttpRequestHeaders headers; |
265 variations::AppendVariationHeaders( | 265 variations::AppendVariationHeaders( |
266 url_fetcher_->GetOriginalURL(), io_data->IsOffTheRecord(), | 266 url_fetcher_->GetOriginalURL(), io_data->IsOffTheRecord(), |
267 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(), | 267 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(), |
268 &headers); | 268 &headers); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 | 659 |
660 void SetReporterLauncherForTesting(const ReporterLauncher& reporter_launcher) { | 660 void SetReporterLauncherForTesting(const ReporterLauncher& reporter_launcher) { |
661 g_reporter_launcher_ = reporter_launcher; | 661 g_reporter_launcher_ = reporter_launcher; |
662 } | 662 } |
663 | 663 |
664 void SetPromptTriggerForTesting(const PromptTrigger& prompt_trigger) { | 664 void SetPromptTriggerForTesting(const PromptTrigger& prompt_trigger) { |
665 g_prompt_trigger_ = prompt_trigger; | 665 g_prompt_trigger_ = prompt_trigger; |
666 } | 666 } |
667 | 667 |
668 } // namespace safe_browsing | 668 } // namespace safe_browsing |
OLD | NEW |