Commit 5a051fb9 authored by Ali Juma's avatar Ali Juma Committed by Commit Bot

[iOS] Stop attempting to sync unsupported Safe Browsing lists

Attempting to sync an unsupported list from the Safe Browsing database
server causes the server to return a 404 error. This CL modifies the
set of lists sync'd on iOS to only include those lists that are supported
for iOS.

Bug: 1071919b
Change-Id: I14d5906c8315fd01e7c7d0933d68752ff2b7ef62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2155010Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Commit-Queue: Ali Juma <ajuma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760171}
parent b4804d8e
......@@ -18,6 +18,7 @@
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "components/safe_browsing/core/common/thread_utils.h"
#include "components/safe_browsing/core/db/v4_protocol_manager_util.h"
#include "crypto/sha2.h"
......@@ -52,15 +53,21 @@ ListInfos GetListInfos() {
// - The list doesn't have hash prefixes to match. All requests lead to full
// hash checks. For instance: GetChromeUrlApiId()
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#if defined(OS_IOS)
const bool kSyncOnlyOnChromeBuilds = false;
const bool kSyncOnlyOnDesktopBuilds = false;
#elif BUILDFLAG(GOOGLE_CHROME_BRANDING)
const bool kSyncOnlyOnChromeBuilds = true;
const bool kSyncOnlyOnDesktopBuilds = true;
#else
const bool kSyncOnlyOnChromeBuilds = false;
const bool kSyncOnlyOnDesktopBuilds = true;
#endif
const bool kSyncAlways = true;
const bool kSyncNever = false;
return ListInfos({
ListInfo(kSyncAlways, "IpMalware.store", GetIpMalwareId(),
ListInfo(kSyncOnlyOnDesktopBuilds, "IpMalware.store", GetIpMalwareId(),
SB_THREAT_TYPE_UNUSED),
ListInfo(kSyncAlways, "UrlSoceng.store", GetUrlSocEngId(),
SB_THREAT_TYPE_URL_PHISHING),
......@@ -68,10 +75,10 @@ ListInfos GetListInfos() {
SB_THREAT_TYPE_URL_MALWARE),
ListInfo(kSyncAlways, "UrlUws.store", GetUrlUwsId(),
SB_THREAT_TYPE_URL_UNWANTED),
ListInfo(kSyncAlways, "UrlMalBin.store", GetUrlMalBinId(),
ListInfo(kSyncOnlyOnDesktopBuilds, "UrlMalBin.store", GetUrlMalBinId(),
SB_THREAT_TYPE_URL_BINARY_MALWARE),
ListInfo(kSyncAlways, "ChromeExtMalware.store", GetChromeExtMalwareId(),
SB_THREAT_TYPE_EXTENSION),
ListInfo(kSyncOnlyOnDesktopBuilds, "ChromeExtMalware.store",
GetChromeExtMalwareId(), SB_THREAT_TYPE_EXTENSION),
ListInfo(kSyncOnlyOnChromeBuilds, "CertCsdDownloadWhitelist.store",
GetCertCsdDownloadWhitelistId(), SB_THREAT_TYPE_UNUSED),
ListInfo(kSyncOnlyOnChromeBuilds, "ChromeUrlClientIncident.store",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment