summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 03:18:51 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 03:18:51 +0000
commit98cb9ff27bbead1151e161f516afc2a4b391536c (patch)
treee26d753591cf12dfffd4713a60fe4d818570d43f /chrome/browser/safe_browsing
parent4c83d1c4917cd75cec3f073cff1c50596380f376 (diff)
downloadchromium_src-98cb9ff27bbead1151e161f516afc2a4b391536c.zip
chromium_src-98cb9ff27bbead1151e161f516afc2a4b391536c.tar.gz
chromium_src-98cb9ff27bbead1151e161f516afc2a4b391536c.tar.bz2
Remove --safebrowsing-download-feedback-url flag.
BUG=354744 Review URL: https://codereview.chromium.org/235503006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
-rw-r--r--chrome/browser/safe_browsing/download_feedback.cc18
-rw-r--r--chrome/browser/safe_browsing/download_feedback.h3
-rw-r--r--chrome/browser/safe_browsing/download_feedback_unittest.cc8
3 files changed, 9 insertions, 20 deletions
diff --git a/chrome/browser/safe_browsing/download_feedback.cc b/chrome/browser/safe_browsing/download_feedback.cc
index b23a313..0a149d6 100644
--- a/chrome/browser/safe_browsing/download_feedback.cc
+++ b/chrome/browser/safe_browsing/download_feedback.cc
@@ -5,11 +5,9 @@
#include "chrome/browser/safe_browsing/download_feedback.h"
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/files/file_util_proxy.h"
#include "base/metrics/histogram.h"
#include "base/task_runner.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "net/base/net_errors.h"
@@ -17,10 +15,6 @@ namespace safe_browsing {
namespace {
-// The default URL where browser sends download feedback requests.
-const char kSbDefaultFeedbackURL[] =
- "https://safebrowsing.google.com/safebrowsing/uploads/chrome";
-
// This enum is used by histograms. Do not change the ordering or remove items.
enum UploadResultType {
UPLOAD_SUCCESS,
@@ -118,8 +112,6 @@ void DownloadFeedbackImpl::Start(const base::Closure& finish_callback) {
DCHECK(CalledOnValidThread());
DCHECK(!uploader_);
- CommandLine* cmdline = CommandLine::ForCurrentProcess();
-
ClientDownloadReport report_metadata;
bool r = report_metadata.mutable_download_request()->ParseFromString(
@@ -130,17 +122,13 @@ void DownloadFeedbackImpl::Start(const base::Closure& finish_callback) {
DCHECK(r);
file_size_ = report_metadata.download_request().length();
- GURL url = GURL(cmdline->HasSwitch(switches::kSbDownloadFeedbackURL) ?
- cmdline->GetSwitchValueASCII(switches::kSbDownloadFeedbackURL) :
- kSbDefaultFeedbackURL);
-
std::string metadata_string;
bool ok = report_metadata.SerializeToString(&metadata_string);
DCHECK(ok);
uploader_.reset(
TwoPhaseUploader::Create(request_context_getter_.get(),
file_task_runner_.get(),
- url,
+ GURL(kSbFeedbackURL),
metadata_string,
file_path_,
TwoPhaseUploader::ProgressCallback(),
@@ -207,6 +195,10 @@ void DownloadFeedbackImpl::RecordUploadResult(UploadResultType result) {
const int64 DownloadFeedback::kMaxUploadSize = 50 * 1024 * 1024;
// static
+const char DownloadFeedback::kSbFeedbackURL[] =
+ "https://safebrowsing.google.com/safebrowsing/uploads/chrome";
+
+// static
DownloadFeedbackFactory* DownloadFeedback::factory_ = NULL;
// static
diff --git a/chrome/browser/safe_browsing/download_feedback.h b/chrome/browser/safe_browsing/download_feedback.h
index 2a9a6c7..6473bda 100644
--- a/chrome/browser/safe_browsing/download_feedback.h
+++ b/chrome/browser/safe_browsing/download_feedback.h
@@ -39,6 +39,9 @@ class DownloadFeedback : public base::NonThreadSafe {
// SBDownloadFeedback.SizeSuccess and SizeFailure histograms.
static const int64 kMaxUploadSize;
+ // The URL where the browser sends download feedback requests.
+ static const char kSbFeedbackURL[];
+
virtual ~DownloadFeedback() {}
// Makes the passed |factory| the factory used to instantiate
diff --git a/chrome/browser/safe_browsing/download_feedback_unittest.cc b/chrome/browser/safe_browsing/download_feedback_unittest.cc
index 460c5ae..db1c1634 100644
--- a/chrome/browser/safe_browsing/download_feedback_unittest.cc
+++ b/chrome/browser/safe_browsing/download_feedback_unittest.cc
@@ -4,14 +4,12 @@
#include "chrome/browser/safe_browsing/download_feedback.h"
-#include "base/command_line.h"
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "chrome/browser/safe_browsing/two_phase_uploader.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread_bundle.h"
@@ -165,10 +163,6 @@ TEST_F(DownloadFeedbackTest, CompleteUpload) {
std::string ping_response(
expected_report_metadata.download_response().SerializeAsString());
- const char kTestFeedbackURL[] = "https://example.com/test/upload";
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kSbDownloadFeedbackURL, kTestFeedbackURL);
-
DownloadFeedback* feedback =
DownloadFeedback::Create(url_request_context_getter_.get(),
file_task_runner_.get(),
@@ -190,7 +184,7 @@ TEST_F(DownloadFeedbackTest, CompleteUpload) {
EXPECT_EQ(upload_file_path_, uploader()->file_path_);
EXPECT_EQ(expected_report_metadata.SerializeAsString(),
uploader()->metadata_);
- EXPECT_EQ(kTestFeedbackURL, uploader()->base_url_.spec());
+ EXPECT_EQ(DownloadFeedback::kSbFeedbackURL, uploader()->base_url_.spec());
EXPECT_TRUE(base::PathExists(upload_file_path_));