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 | 635 // Note: It's OK to pass |is_signed_in| false if it's unknown, as it does |
636 // transmission of experiment ids coming from the variations server. | 636 // not affect transmission of experiments coming from the variations server. |
637 bool is_signed_in = false; | 637 bool is_signed_in = false; |
638 variations::AppendVariationHeaders( | 638 variations::AppendVariationHeaders( |
639 url_fetcher_->GetOriginalURL(), io_data->IsOffTheRecord(), | 639 url_fetcher_->GetOriginalURL(), io_data->IsOffTheRecord(), |
640 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(), | 640 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(), |
641 is_signed_in, &headers); | 641 is_signed_in, &headers); |
642 url_fetcher_->SetExtraRequestHeaders(headers.ToString()); | 642 url_fetcher_->SetExtraRequestHeaders(headers.ToString()); |
643 url_fetcher_->Start(); | 643 url_fetcher_->Start(); |
644 } | 644 } |
645 | 645 |
646 // net::URLFetcherDelegate: | 646 // net::URLFetcherDelegate: |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), | 1098 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), |
1099 KEY_QUERY_VALUE) == ERROR_SUCCESS && | 1099 KEY_QUERY_VALUE) == ERROR_SUCCESS && |
1100 srt_cleaner_key.GetValueCount() > 0; | 1100 srt_cleaner_key.GetValueCount() > 0; |
1101 } | 1101 } |
1102 | 1102 |
1103 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { | 1103 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { |
1104 g_testing_delegate_ = delegate; | 1104 g_testing_delegate_ = delegate; |
1105 } | 1105 } |
1106 | 1106 |
1107 } // namespace safe_browsing | 1107 } // namespace safe_browsing |
OLD | NEW |