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 <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE); | 625 url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE); |
626 url_fetcher_->SetMaxRetriesOn5xx(3); | 626 url_fetcher_->SetMaxRetriesOn5xx(3); |
627 url_fetcher_->SaveResponseToTemporaryFile( | 627 url_fetcher_->SaveResponseToTemporaryFile( |
628 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); | 628 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); |
629 url_fetcher_->SetRequestContext( | 629 url_fetcher_->SetRequestContext( |
630 g_browser_process->system_request_context()); | 630 g_browser_process->system_request_context()); |
631 // Adds the UMA bit to the download request if the user is enrolled in UMA. | 631 // Adds the UMA bit to the download request if the user is enrolled in UMA. |
632 ProfileIOData* io_data = ProfileIOData::FromResourceContext( | 632 ProfileIOData* io_data = ProfileIOData::FromResourceContext( |
633 profile_->GetResourceContext()); | 633 profile_->GetResourceContext()); |
634 net::HttpRequestHeaders headers; | 634 net::HttpRequestHeaders headers; |
635 // Note: It's fine to pass in |is_signed_in| false, which does not affect | |
636 // transmission of experiment ids coming from the variations server. | |
637 bool is_signed_in = false; | |
638 variations::AppendVariationHeaders( | 635 variations::AppendVariationHeaders( |
639 url_fetcher_->GetOriginalURL(), io_data->IsOffTheRecord(), | 636 url_fetcher_->GetOriginalURL(), io_data->IsOffTheRecord(), |
640 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(), | 637 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(), |
641 is_signed_in, &headers); | 638 &headers); |
642 url_fetcher_->SetExtraRequestHeaders(headers.ToString()); | 639 url_fetcher_->SetExtraRequestHeaders(headers.ToString()); |
643 url_fetcher_->Start(); | 640 url_fetcher_->Start(); |
644 } | 641 } |
645 | 642 |
646 // net::URLFetcherDelegate: | 643 // net::URLFetcherDelegate: |
647 void OnURLFetchComplete(const net::URLFetcher* source) override { | 644 void OnURLFetchComplete(const net::URLFetcher* source) override { |
648 // Take ownership of the fetcher in this scope (source == url_fetcher_). | 645 // Take ownership of the fetcher in this scope (source == url_fetcher_). |
649 DCHECK_EQ(url_fetcher_.get(), source); | 646 DCHECK_EQ(url_fetcher_.get(), source); |
650 | 647 |
651 base::FilePath download_path; | 648 base::FilePath download_path; |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), | 1093 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), |
1097 KEY_QUERY_VALUE) == ERROR_SUCCESS && | 1094 KEY_QUERY_VALUE) == ERROR_SUCCESS && |
1098 srt_cleaner_key.GetValueCount() > 0; | 1095 srt_cleaner_key.GetValueCount() > 0; |
1099 } | 1096 } |
1100 | 1097 |
1101 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { | 1098 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { |
1102 g_testing_delegate_ = delegate; | 1099 g_testing_delegate_ = delegate; |
1103 } | 1100 } |
1104 | 1101 |
1105 } // namespace safe_browsing | 1102 } // namespace safe_browsing |
OLD | NEW |