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

Unified Diff: chrome/browser/safe_browsing/two_phase_uploader.cc

Issue 2276933003: Add data usage tracking for safe browsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/two_phase_uploader.cc
diff --git a/chrome/browser/safe_browsing/two_phase_uploader.cc b/chrome/browser/safe_browsing/two_phase_uploader.cc
index 7e719c5214a0d329c93ebae593edae40368f4d1c..07e71bbe7c40080e28a909684c5ab7289749a1d7 100644
--- a/chrome/browser/safe_browsing/two_phase_uploader.cc
+++ b/chrome/browser/safe_browsing/two_phase_uploader.cc
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/task_runner.h"
+#include "components/data_use_measurement/core/data_use_user_data.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
@@ -169,6 +170,8 @@ void TwoPhaseUploaderImpl::UploadMetadata() {
state_ = UPLOAD_METADATA;
url_fetcher_ =
net::URLFetcher::Create(base_url_, net::URLFetcher::POST, this);
+ data_use_measurement::DataUseUserData::AttachToFetcher(
+ url_fetcher_.get(), data_use_measurement::DataUseUserData::SAFE_BROWSING);
url_fetcher_->SetRequestContext(url_request_context_getter_.get());
url_fetcher_->SetExtraRequestHeaders(kStartHeader);
url_fetcher_->SetUploadData(kUploadContentType, metadata_);
@@ -181,6 +184,8 @@ void TwoPhaseUploaderImpl::UploadFile() {
url_fetcher_ =
net::URLFetcher::Create(upload_url_, net::URLFetcher::PUT, this);
+ data_use_measurement::DataUseUserData::AttachToFetcher(
+ url_fetcher_.get(), data_use_measurement::DataUseUserData::SAFE_BROWSING);
url_fetcher_->SetRequestContext(url_request_context_getter_.get());
url_fetcher_->SetUploadFilePath(kUploadContentType, file_path_, 0,
std::numeric_limits<uint64_t>::max(),
« no previous file with comments | « chrome/browser/safe_browsing/threat_details_cache.cc ('k') | components/data_use_measurement/core/data_use_user_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698