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

Unified Diff: chrome/browser/download/download_browsertest.cc

Issue 1818133002: Move TestSafeBrowsingService* to anonymous namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index 00954d212feb5905851d866209819017b0ce9686..35a82cc10f7cfbef97c67c800f7b36762dd045a7 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -1077,80 +1077,84 @@ class DownloadTest : public InProcessBrowserTest {
scoped_ptr<DownloadTestFileActivityObserver> file_activity_observer_;
};
-class FakeDownloadProtectionService
- : public safe_browsing::DownloadProtectionService {
- public:
- FakeDownloadProtectionService()
- : safe_browsing::DownloadProtectionService(nullptr, nullptr) {}
+namespace {
- void CheckClientDownload(DownloadItem* download_item,
- const CheckDownloadCallback& callback) override {
- callback.Run(
- safe_browsing::DownloadProtectionService::UNCOMMON);
- }
-};
+ class FakeDownloadProtectionService
Nico 2016/03/21 19:51:01 don't intend inside of namespaces. (in general, r
+ : public safe_browsing::DownloadProtectionService {
+ public:
+ FakeDownloadProtectionService()
+ : safe_browsing::DownloadProtectionService(nullptr, nullptr) {}
-class FakeSafeBrowsingService : public safe_browsing::SafeBrowsingService {
- public:
- FakeSafeBrowsingService() {}
+ void CheckClientDownload(DownloadItem* download_item,
+ const CheckDownloadCallback& callback) override {
+ callback.Run(
+ safe_browsing::DownloadProtectionService::UNCOMMON);
+ }
+ };
- safe_browsing::DownloadProtectionService* CreateDownloadProtectionService(
- net::URLRequestContextGetter* not_used_request_context_getter) override {
- return new FakeDownloadProtectionService();
- }
+ class FakeSafeBrowsingService : public safe_browsing::SafeBrowsingService {
+ public:
+ FakeSafeBrowsingService() {}
- std::string GetDownloadReport() const { return report_; }
+ safe_browsing::DownloadProtectionService* CreateDownloadProtectionService(
+ net::URLRequestContextGetter* unused_request_context_getter) override {
+ return new FakeDownloadProtectionService();
+ }
- protected:
- ~FakeSafeBrowsingService() override {}
+ std::string GetDownloadReport() const { return report_; }
- void SendSerializedDownloadReport(const std::string& report) override {
- report_ = report;
- }
+ protected:
+ ~FakeSafeBrowsingService() override {}
- std::string report_;
-};
+ void SendSerializedDownloadReport(const std::string& report) override {
+ report_ = report;
+ }
-// Factory that creates FakeSafeBrowsingService instances.
-class TestSafeBrowsingServiceFactory
- : public safe_browsing::SafeBrowsingServiceFactory {
- public:
- TestSafeBrowsingServiceFactory() : fake_safe_browsing_service_(nullptr) {}
- ~TestSafeBrowsingServiceFactory() override {}
+ std::string report_;
+ };
- safe_browsing::SafeBrowsingService* CreateSafeBrowsingService() override {
- DCHECK(!fake_safe_browsing_service_);
- fake_safe_browsing_service_ = new FakeSafeBrowsingService();
- return fake_safe_browsing_service_.get();
- }
+ // Factory that creates FakeSafeBrowsingService instances.
+ class TestSafeBrowsingServiceFactory
+ : public safe_browsing::SafeBrowsingServiceFactory {
+ public:
+ TestSafeBrowsingServiceFactory() : fake_safe_browsing_service_(nullptr) {}
+ ~TestSafeBrowsingServiceFactory() override {}
+
+ safe_browsing::SafeBrowsingService* CreateSafeBrowsingService() override {
+ DCHECK(!fake_safe_browsing_service_);
+ fake_safe_browsing_service_ = new FakeSafeBrowsingService();
+ return fake_safe_browsing_service_.get();
+ }
- scoped_refptr<FakeSafeBrowsingService> fake_safe_browsing_service() {
- return fake_safe_browsing_service_;
- }
+ scoped_refptr<FakeSafeBrowsingService> fake_safe_browsing_service() {
+ return fake_safe_browsing_service_;
+ }
- private:
- scoped_refptr<FakeSafeBrowsingService> fake_safe_browsing_service_;
-};
+ private:
+ scoped_refptr<FakeSafeBrowsingService> fake_safe_browsing_service_;
+ };
-class DownloadTestWithFakeSafeBrowsing : public DownloadTest {
- public:
- DownloadTestWithFakeSafeBrowsing()
- : test_safe_browsing_factory_(new TestSafeBrowsingServiceFactory()) {}
+ class DownloadTestWithFakeSafeBrowsing : public DownloadTest {
+ public:
+ DownloadTestWithFakeSafeBrowsing()
+ : test_safe_browsing_factory_(new TestSafeBrowsingServiceFactory()) {}
- void SetUp() override {
- safe_browsing::SafeBrowsingService::RegisterFactory(
- test_safe_browsing_factory_.get());
- DownloadTest::SetUp();
- }
+ void SetUp() override {
+ safe_browsing::SafeBrowsingService::RegisterFactory(
+ test_safe_browsing_factory_.get());
+ DownloadTest::SetUp();
+ }
- void TearDown() override {
- safe_browsing::SafeBrowsingService::RegisterFactory(nullptr);
- DownloadTest::TearDown();
- }
+ void TearDown() override {
+ safe_browsing::SafeBrowsingService::RegisterFactory(nullptr);
+ DownloadTest::TearDown();
+ }
- protected:
- scoped_ptr<TestSafeBrowsingServiceFactory> test_safe_browsing_factory_;
-};
+ protected:
+ scoped_ptr<TestSafeBrowsingServiceFactory> test_safe_browsing_factory_;
+ };
+
+} // namespace
// NOTES:
//
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698