Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Side by Side Diff: chrome/browser/safe_browsing/srt_fetcher_win.cc

Issue 2558913003: Restrict transmission of external exp ids to signed in users. (Closed)
Patch Set: Address nit. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
635 variations::AppendVariationHeaders( 638 variations::AppendVariationHeaders(
636 url_fetcher_->GetOriginalURL(), io_data->IsOffTheRecord(), 639 url_fetcher_->GetOriginalURL(), io_data->IsOffTheRecord(),
637 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(), 640 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(),
638 &headers); 641 is_signed_in, &headers);
639 url_fetcher_->SetExtraRequestHeaders(headers.ToString()); 642 url_fetcher_->SetExtraRequestHeaders(headers.ToString());
640 url_fetcher_->Start(); 643 url_fetcher_->Start();
641 } 644 }
642 645
643 // net::URLFetcherDelegate: 646 // net::URLFetcherDelegate:
644 void OnURLFetchComplete(const net::URLFetcher* source) override { 647 void OnURLFetchComplete(const net::URLFetcher* source) override {
645 // Take ownership of the fetcher in this scope (source == url_fetcher_). 648 // Take ownership of the fetcher in this scope (source == url_fetcher_).
646 DCHECK_EQ(url_fetcher_.get(), source); 649 DCHECK_EQ(url_fetcher_.get(), source);
647 650
648 base::FilePath download_path; 651 base::FilePath download_path;
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), 1096 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(),
1094 KEY_QUERY_VALUE) == ERROR_SUCCESS && 1097 KEY_QUERY_VALUE) == ERROR_SUCCESS &&
1095 srt_cleaner_key.GetValueCount() > 0; 1098 srt_cleaner_key.GetValueCount() > 0;
1096 } 1099 }
1097 1100
1098 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { 1101 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) {
1099 g_testing_delegate_ = delegate; 1102 g_testing_delegate_ = delegate;
1100 } 1103 }
1101 1104
1102 } // namespace safe_browsing 1105 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698