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

Unified Diff: components/safe_browsing_db/v4_local_database_manager.cc

Issue 2225113002: Reland: Move PVer4 related code from util.* to v4_protocol_manager_util.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor: Address nparker@'s comments Created 4 years, 4 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: components/safe_browsing_db/v4_local_database_manager.cc
diff --git a/components/safe_browsing_db/v4_local_database_manager.cc b/components/safe_browsing_db/v4_local_database_manager.cc
index 8432b4b59281c7477b01c97812dfc8be11beefb7..5f555cfdd7333dc436696c4ac30767de7c779eb8 100644
--- a/components/safe_browsing_db/v4_local_database_manager.cc
+++ b/components/safe_browsing_db/v4_local_database_manager.cc
@@ -10,7 +10,6 @@
#include <vector>
#include "base/callback.h"
-#include "components/safe_browsing_db/safebrowsing.pb.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
@@ -18,29 +17,12 @@ using content::BrowserThread;
namespace safe_browsing {
namespace {
-#if defined(OS_WIN)
-#define PLATFORM_TYPE WINDOWS_PLATFORM
-#elif defined(OS_LINUX)
-#define PLATFORM_TYPE LINUX_PLATFORM
-#elif defined(OS_MACOSX)
-#define PLATFORM_TYPE OSX_PLATFORM
-#else
-// This should ideally never compile but it is getting compiled on Android.
-// See: https://bugs.chromium.org/p/chromium/issues/detail?id=621647
-// TODO(vakh): Once that bug is fixed, this should be removed. If we leave
-// the platform_type empty, the server won't recognize the request and
-// return an error response which will pollute our UMA metrics.
-#define PLATFORM_TYPE LINUX_PLATFORM
-#endif
// TODO(vakh): Implement this to populate the map appopriately.
// Filed as http://crbug.com/608075
StoreFileNameMap GetStoreFileNameMap() {
- return StoreFileNameMap(
- {{UpdateListIdentifier(PLATFORM_TYPE, URL, MALWARE_THREAT),
- "UrlMalware.store"},
- {UpdateListIdentifier(PLATFORM_TYPE, URL, SOCIAL_ENGINEERING_PUBLIC),
- "UrlSoceng.store"}});
+ return StoreFileNameMap({{GetUrlMalwareId(), "UrlMalware.store"},
+ {GetUrlSocEngId(), "UrlSoceng.store"}});
}
} // namespace
@@ -154,7 +136,7 @@ bool V4LocalDatabaseManager::IsCsdWhitelistKillSwitchOn() {
bool V4LocalDatabaseManager::CheckBrowseUrl(const GURL& url, Client* client) {
// TODO(vakh): Implement this skeleton.
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- if (!enabled_) {
+ if (!enabled_ || !CanCheckUrl(url)) {
return true;
}
« no previous file with comments | « components/safe_browsing_db/util_unittest.cc ('k') | components/safe_browsing_db/v4_protocol_manager_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698