diff --git a/components/safe_browsing/android/safe_browsing_api_handler_bridge.cc b/components/safe_browsing/android/safe_browsing_api_handler_bridge.cc index c169da3273a977..279a4fcd72a702 100644 --- a/components/safe_browsing/android/safe_browsing_api_handler_bridge.cc +++ b/components/safe_browsing/android/safe_browsing_api_handler_bridge.cc @@ -152,8 +152,9 @@ SafeBrowsingJavaValidationResult GetJavaValidationResult( case SafeBrowsingJavaThreatType::SOCIAL_ENGINEERING: case SafeBrowsingJavaThreatType::UNWANTED_SOFTWARE: case SafeBrowsingJavaThreatType::POTENTIALLY_HARMFUL_APPLICATION: - case SafeBrowsingJavaThreatType::SUBRESOURCE_FILTER: case SafeBrowsingJavaThreatType::BILLING: + case SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION: + case SafeBrowsingJavaThreatType::BETTER_ADS_VIOLATION: is_threat_type_recognized = true; break; } @@ -325,10 +326,11 @@ SBThreatType SafeBrowsingJavaToSBThreatType( return SB_THREAT_TYPE_URL_UNWANTED; case SafeBrowsingJavaThreatType::POTENTIALLY_HARMFUL_APPLICATION: return SB_THREAT_TYPE_URL_MALWARE; - case SafeBrowsingJavaThreatType::SUBRESOURCE_FILTER: - return SB_THREAT_TYPE_SUBRESOURCE_FILTER; case SafeBrowsingJavaThreatType::BILLING: return SB_THREAT_TYPE_BILLING; + case SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION: + case SafeBrowsingJavaThreatType::BETTER_ADS_VIOLATION: + return SB_THREAT_TYPE_SUBRESOURCE_FILTER; } } @@ -343,8 +345,6 @@ SafeBrowsingJavaThreatType SBThreatTypeToSafeBrowsingApiJavaThreatType( return SafeBrowsingJavaThreatType::UNWANTED_SOFTWARE; case SB_THREAT_TYPE_URL_MALWARE: return SafeBrowsingJavaThreatType::POTENTIALLY_HARMFUL_APPLICATION; - case SB_THREAT_TYPE_SUBRESOURCE_FILTER: - return SafeBrowsingJavaThreatType::SUBRESOURCE_FILTER; case SB_THREAT_TYPE_BILLING: return SafeBrowsingJavaThreatType::BILLING; default: @@ -359,13 +359,24 @@ ScopedJavaLocalRef SBThreatTypeSetToSafeBrowsingJavaArray( JNIEnv* env, const SBThreatTypeSet& threat_types) { DCHECK_LT(0u, threat_types.size()); - int int_threat_types[threat_types.size()]; + size_t threat_type_size = + base::Contains(threat_types, SB_THREAT_TYPE_SUBRESOURCE_FILTER) + ? threat_types.size() + 1 + : threat_types.size(); + int int_threat_types[threat_type_size]; int* itr = &int_threat_types[0]; for (auto threat_type : threat_types) { - *itr++ = static_cast( - SBThreatTypeToSafeBrowsingApiJavaThreatType(threat_type)); + if (threat_type == SB_THREAT_TYPE_SUBRESOURCE_FILTER) { + *itr++ = static_cast( + SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION); + *itr++ = + static_cast(SafeBrowsingJavaThreatType::BETTER_ADS_VIOLATION); + } else { + *itr++ = static_cast( + SBThreatTypeToSafeBrowsingApiJavaThreatType(threat_type)); + } } - return ToJavaIntArray(env, int_threat_types, threat_types.size()); + return ToJavaIntArray(env, int_threat_types, threat_type_size); } // The map that holds the callback_id used to reference each pending SafetyNet @@ -575,15 +586,10 @@ void OnUrlCheckDoneOnSBThreadBySafeBrowsingApi( return; } - // The API currently doesn't have required threat types - // (ABUSIVE_EXPERIENCE_VIOLATION, BETTER_ADS_VIOLATION) to work with threat - // attributes, so threat attributes are currently disabled. It should not - // affect browse URL checks (mainframe and subresource URLs). However, this - // must be changed before it is used for subresource filter checks. - // Similarly, threat attributes must be consumed if we decide to use malware - // landing info on Android. std::move(*(callback->response_callback)) - .Run(SafeBrowsingJavaToSBThreatType(threat_type), ThreatMetadata()); + .Run( + SafeBrowsingJavaToSBThreatType(threat_type), + GetThreatMetadataFromSafeBrowsingApi(threat_type, threat_attributes)); } // Java->Native call, invoked when a SafeBrowsing check is done. |env| is the @@ -635,17 +641,21 @@ void SafeBrowsingApiHandlerBridge::StartHashDatabaseUrlCheck( std::unique_ptr callback, const GURL& url, const SBThreatTypeSet& threat_types) { - // The SafeBrowsing API currently doesn't have required threat types - // (ABUSIVE_EXPERIENCE_VIOLATION, BETTER_ADS_VIOLATION) to perform subresource - // filter checks, so only checking the browse URLs. - if (SBThreatTypeSetIsValidForCheckBrowseUrl(threat_types) && - base::FeatureList::IsEnabled( - kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck)) { + bool for_browse_url = SBThreatTypeSetIsValidForCheckBrowseUrl(threat_types); + if (for_browse_url && base::FeatureList::IsEnabled( + kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck)) { StartUrlCheckBySafeBrowsing(std::move(callback), url, threat_types, SafeBrowsingJavaProtocol::LOCAL_BLOCK_LIST); - } else { - StartUrlCheckBySafetyNet(std::move(callback), url, threat_types); + return; } + if (!for_browse_url && base::FeatureList::IsEnabled( + kSafeBrowsingNewGmsApiForSubresourceFilterCheck)) { + StartUrlCheckBySafeBrowsing(std::move(callback), url, threat_types, + SafeBrowsingJavaProtocol::LOCAL_BLOCK_LIST); + return; + } + + StartUrlCheckBySafetyNet(std::move(callback), url, threat_types); } void SafeBrowsingApiHandlerBridge::StartHashRealTimeUrlCheck( diff --git a/components/safe_browsing/android/safe_browsing_api_handler_bridge_unittest.cc b/components/safe_browsing/android/safe_browsing_api_handler_bridge_unittest.cc index 72db470347369b..687290be192bfc 100644 --- a/components/safe_browsing/android/safe_browsing_api_handler_bridge_unittest.cc +++ b/components/safe_browsing/android/safe_browsing_api_handler_bridge_unittest.cc @@ -63,8 +63,10 @@ SBThreatTypeSet GetAllThreatTypes() { class SafeBrowsingApiHandlerBridgeTest : public testing::Test { public: SafeBrowsingApiHandlerBridgeTest() { - feature_list_.InitAndEnableFeature( - safe_browsing::kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck); + feature_list_.InitWithFeatures( + {safe_browsing::kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck, + safe_browsing::kSafeBrowsingNewGmsApiForSubresourceFilterCheck}, + {}); } void SetUp() override { @@ -369,21 +371,40 @@ TEST_F(SafeBrowsingApiHandlerBridgeTest, TEST_F(SafeBrowsingApiHandlerBridgeTest, HashDatabaseUrlCheck_ThreatMatchWithSubresourceFilter) { + base::HistogramTester histogram_tester; GURL url("https://example.com"); - std::string metadata = - "{\"matches\":[{\"threat_type\":\"13\", " - "\"sf_absv\":\"enforce\"}]}"; - AddSafetyNetBlocklistResponse(url, metadata, - {SafetyNetJavaThreatType::SUBRESOURCE_FILTER}); + AddSafeBrowsingResponse( + url, SafeBrowsingApiLookupResult::SUCCESS, + SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION, + {SafeBrowsingJavaThreatAttribute::CANARY}, + SafeBrowsingJavaResponseStatus::SUCCESS_WITH_LOCAL_BLOCKLIST, + {SafeBrowsingJavaThreatType::SOCIAL_ENGINEERING, + SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION, + SafeBrowsingJavaThreatType::BETTER_ADS_VIOLATION}, + SafeBrowsingJavaProtocol::LOCAL_BLOCK_LIST); RunHashDatabaseUrlCheck( - url, /*threat_types=*/{SB_THREAT_TYPE_SUBRESOURCE_FILTER}, + url, /*threat_types=*/ + {SB_THREAT_TYPE_URL_PHISHING, SB_THREAT_TYPE_SUBRESOURCE_FILTER}, /*expected_threat_type=*/SB_THREAT_TYPE_SUBRESOURCE_FILTER, /*expected_subresource_filter_match=*/ - {{SubresourceFilterType::ABUSIVE, SubresourceFilterLevel::ENFORCE}}); + {{SubresourceFilterType::ABUSIVE, SubresourceFilterLevel::WARN}}); - CheckSafetyNetApiHistogramValues( - /*expected_result=*/UmaRemoteCallResult::MATCH); + CheckSafeBrowsingApiHistogramValues( + ".LocalBlocklist", + /*expected_is_available=*/true, + /*expected_validation_result=*/SafeBrowsingJavaValidationResult::VALID, + /*expected_lookup_result=*/ + static_cast(SafeBrowsingApiLookupResult::SUCCESS), + /*expected_threat_type=*/ + static_cast( + SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION), + /*expected_threat_attribute=*/1, + /*expected_threat_attribute_count=*/ + static_cast(SafeBrowsingJavaThreatAttribute::CANARY), + /*expected_response_status=*/ + static_cast( + SafeBrowsingJavaResponseStatus::SUCCESS_WITH_LOCAL_BLOCKLIST)); } TEST_F(SafeBrowsingApiHandlerBridgeTest, @@ -785,8 +806,9 @@ class SafeBrowsingApiHandlerBridgeNewGmsApiDisabledTest : public SafeBrowsingApiHandlerBridgeTest { public: SafeBrowsingApiHandlerBridgeNewGmsApiDisabledTest() { - feature_list_.InitAndDisableFeature( - safe_browsing::kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck); + feature_list_.InitWithFeatures( + {}, {safe_browsing::kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck, + safe_browsing::kSafeBrowsingNewGmsApiForSubresourceFilterCheck}); } protected: @@ -844,6 +866,25 @@ TEST_F(SafeBrowsingApiHandlerBridgeNewGmsApiDisabledTest, /*expected_result=*/UmaRemoteCallResult::MATCH); } +TEST_F(SafeBrowsingApiHandlerBridgeNewGmsApiDisabledTest, + HashDatabaseUrlCheck_ThreatMatchWithSubresourceFilter) { + GURL url("https://example.com"); + std::string metadata = + "{\"matches\":[{\"threat_type\":\"13\", " + "\"sf_absv\":\"enforce\"}]}"; + AddSafetyNetBlocklistResponse(url, metadata, + {SafetyNetJavaThreatType::SUBRESOURCE_FILTER}); + + RunHashDatabaseUrlCheck( + url, /*threat_types=*/{SB_THREAT_TYPE_SUBRESOURCE_FILTER}, + /*expected_threat_type=*/SB_THREAT_TYPE_SUBRESOURCE_FILTER, + /*expected_subresource_filter_match=*/ + {{SubresourceFilterType::ABUSIVE, SubresourceFilterLevel::ENFORCE}}); + + CheckSafetyNetApiHistogramValues( + /*expected_result=*/UmaRemoteCallResult::MATCH); +} + TEST_F(SafeBrowsingApiHandlerBridgeNewGmsApiDisabledTest, HashDatabaseUrlCheck_MultipleRequests) { GURL unsafe_url("https://unsafe.com"); @@ -933,4 +974,97 @@ TEST_F(SafeBrowsingApiHandlerBridgeNewGmsApiDisabledTest, /*expected_threat_type=*/SB_THREAT_TYPE_SAFE); } +class SafeBrowsingApiHandlerBridgeNewGmsApiForBrowseUrlDisabledTest + : public SafeBrowsingApiHandlerBridgeTest { + public: + SafeBrowsingApiHandlerBridgeNewGmsApiForBrowseUrlDisabledTest() { + feature_list_.InitWithFeatures( + {safe_browsing::kSafeBrowsingNewGmsApiForSubresourceFilterCheck}, + {safe_browsing::kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck}); + } + + protected: + base::test::ScopedFeatureList feature_list_; +}; + +TEST_F(SafeBrowsingApiHandlerBridgeNewGmsApiForBrowseUrlDisabledTest, + HashDatabaseUrlCheck_SingleThreatMatch) { + GURL url("https://example.com"); + // threat_type: 3 is unwanted. + std::string metadata = "{\"matches\":[{\"threat_type\":\"3\"}]}"; + AddSafetyNetBlocklistResponse(url, metadata, + GetAllSafetyNetThreatsOfInterest()); + + RunHashDatabaseUrlCheck(url, /*threat_types=*/GetAllThreatTypes(), + /*expected_threat_type=*/SB_THREAT_TYPE_URL_UNWANTED, + /*expected_subresource_filter_match=*/{}); +} + +TEST_F(SafeBrowsingApiHandlerBridgeNewGmsApiForBrowseUrlDisabledTest, + HashDatabaseUrlCheck_ThreatMatchWithSubresourceFilter) { + GURL url("https://example.com"); + // Subresource filter is still checked through the new API. + AddSafeBrowsingResponse( + url, SafeBrowsingApiLookupResult::SUCCESS, + SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION, + {SafeBrowsingJavaThreatAttribute::CANARY}, + SafeBrowsingJavaResponseStatus::SUCCESS_WITH_LOCAL_BLOCKLIST, + {SafeBrowsingJavaThreatType::SOCIAL_ENGINEERING, + SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION, + SafeBrowsingJavaThreatType::BETTER_ADS_VIOLATION}, + SafeBrowsingJavaProtocol::LOCAL_BLOCK_LIST); + + RunHashDatabaseUrlCheck( + url, /*threat_types=*/ + {SB_THREAT_TYPE_URL_PHISHING, SB_THREAT_TYPE_SUBRESOURCE_FILTER}, + /*expected_threat_type=*/SB_THREAT_TYPE_SUBRESOURCE_FILTER, + /*expected_subresource_filter_match=*/ + {{SubresourceFilterType::ABUSIVE, SubresourceFilterLevel::WARN}}); +} + +class SafeBrowsingApiHandlerBridgeNewGmsApiForSubresourceFilterDisabledTest + : public SafeBrowsingApiHandlerBridgeTest { + public: + SafeBrowsingApiHandlerBridgeNewGmsApiForSubresourceFilterDisabledTest() { + feature_list_.InitWithFeatures( + {safe_browsing::kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck}, + {safe_browsing::kSafeBrowsingNewGmsApiForSubresourceFilterCheck}); + } + + protected: + base::test::ScopedFeatureList feature_list_; +}; + +TEST_F(SafeBrowsingApiHandlerBridgeNewGmsApiForSubresourceFilterDisabledTest, + HashDatabaseUrlCheck_SingleThreatMatch) { + GURL url("https://example.com"); + // Browse URL is still checked through the new API. + AddSafeBrowsingResponse( + url, SafeBrowsingApiLookupResult::SUCCESS, + SafeBrowsingJavaThreatType::UNWANTED_SOFTWARE, {}, + SafeBrowsingJavaResponseStatus::SUCCESS_WITH_LOCAL_BLOCKLIST, + GetAllSafeBrowsingThreatTypes(), + SafeBrowsingJavaProtocol::LOCAL_BLOCK_LIST); + + RunHashDatabaseUrlCheck(url, /*threat_types=*/GetAllThreatTypes(), + /*expected_threat_type=*/SB_THREAT_TYPE_URL_UNWANTED, + /*expected_subresource_filter_match=*/{}); +} + +TEST_F(SafeBrowsingApiHandlerBridgeNewGmsApiForSubresourceFilterDisabledTest, + HashDatabaseUrlCheck_ThreatMatchWithSubresourceFilter) { + GURL url("https://example.com"); + std::string metadata = + "{\"matches\":[{\"threat_type\":\"13\", " + "\"sf_absv\":\"enforce\"}]}"; + AddSafetyNetBlocklistResponse(url, metadata, + {SafetyNetJavaThreatType::SUBRESOURCE_FILTER}); + + RunHashDatabaseUrlCheck( + url, /*threat_types=*/{SB_THREAT_TYPE_SUBRESOURCE_FILTER}, + /*expected_threat_type=*/SB_THREAT_TYPE_SUBRESOURCE_FILTER, + /*expected_subresource_filter_match=*/ + {{SubresourceFilterType::ABUSIVE, SubresourceFilterLevel::ENFORCE}}); +} + } // namespace safe_browsing diff --git a/components/safe_browsing/android/safe_browsing_api_handler_util.cc b/components/safe_browsing/android/safe_browsing_api_handler_util.cc index 5723a9a3edc921..0ff22f5bac99a8 100644 --- a/components/safe_browsing/android/safe_browsing_api_handler_util.cc +++ b/components/safe_browsing/android/safe_browsing_api_handler_util.cc @@ -174,4 +174,45 @@ UmaRemoteCallResult ParseJsonFromGMSCore(const std::string& metadata_str, return UmaRemoteCallResult::MATCH; // success } +ThreatMetadata GetThreatMetadataFromSafeBrowsingApi( + SafeBrowsingJavaThreatType threat_type, + const std::vector& threat_attributes) { + bool is_relevant_threat_type = false; + SubresourceFilterType type; + switch (threat_type) { + case SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION: + is_relevant_threat_type = true; + type = SubresourceFilterType::ABUSIVE; + break; + case SafeBrowsingJavaThreatType::BETTER_ADS_VIOLATION: + is_relevant_threat_type = true; + type = SubresourceFilterType::BETTER_ADS; + break; + case SafeBrowsingJavaThreatType::NO_THREAT: + case SafeBrowsingJavaThreatType::SOCIAL_ENGINEERING: + case SafeBrowsingJavaThreatType::UNWANTED_SOFTWARE: + case SafeBrowsingJavaThreatType::POTENTIALLY_HARMFUL_APPLICATION: + case SafeBrowsingJavaThreatType::BILLING: + break; + } + if (!is_relevant_threat_type) { + return ThreatMetadata(); + } + // Filter level is default to ENFORCE. + SubresourceFilterLevel level = SubresourceFilterLevel::ENFORCE; + for (int threat_attribute : threat_attributes) { + if (threat_attribute == + static_cast(SafeBrowsingJavaThreatAttribute::CANARY)) { + level = SubresourceFilterLevel::WARN; + break; + } + } + + SubresourceFilterMatch subresource_filter_match; + subresource_filter_match[type] = level; + ThreatMetadata threat_metadata; + threat_metadata.subresource_filter_match = subresource_filter_match; + return threat_metadata; +} + } // namespace safe_browsing diff --git a/components/safe_browsing/android/safe_browsing_api_handler_util.h b/components/safe_browsing/android/safe_browsing_api_handler_util.h index a1a9ce45f6fc69..92e49860527701 100644 --- a/components/safe_browsing/android/safe_browsing_api_handler_util.h +++ b/components/safe_browsing/android/safe_browsing_api_handler_util.h @@ -67,8 +67,9 @@ enum class SafeBrowsingJavaThreatType { SOCIAL_ENGINEERING = 2, UNWANTED_SOFTWARE = 3, POTENTIALLY_HARMFUL_APPLICATION = 4, - SUBRESOURCE_FILTER = 13, - BILLING = 15 + BILLING = 15, + ABUSIVE_EXPERIENCE_VIOLATION = 20, + BETTER_ADS_VIOLATION = 21 }; // Must match the definition in SafeBrowsing::ThreatAttribute in SafeBrowsing @@ -134,6 +135,12 @@ UmaRemoteCallResult ParseJsonFromGMSCore(const std::string& metadata_str, SBThreatType* worst_threat, ThreatMetadata* metadata); +// Translates |threat_type| and |threat_attributes| from the Safe Browsing API +// into ThreatMetadata. +ThreatMetadata GetThreatMetadataFromSafeBrowsingApi( + SafeBrowsingJavaThreatType threat_type, + const std::vector& threat_attributes); + } // namespace safe_browsing #endif // COMPONENTS_SAFE_BROWSING_ANDROID_SAFE_BROWSING_API_HANDLER_UTIL_H_ diff --git a/components/safe_browsing/android/safe_browsing_api_handler_util_unittest.cc b/components/safe_browsing/android/safe_browsing_api_handler_util_unittest.cc index 4fd591e9429115..e1a975c10ea1b9 100644 --- a/components/safe_browsing/android/safe_browsing_api_handler_util_unittest.cc +++ b/components/safe_browsing/android/safe_browsing_api_handler_util_unittest.cc @@ -145,4 +145,41 @@ TEST_F(SafeBrowsingApiHandlerUtilTest, SubresourceFilterSubTypes) { } } +TEST_F(SafeBrowsingApiHandlerUtilTest, GetThreatMetadataFromSafeBrowsingApi) { + typedef SubresourceFilterLevel Level; + typedef SubresourceFilterType Type; + const struct { + SafeBrowsingJavaThreatType threat_type; + std::vector threat_attributes; + SubresourceFilterMatch expected_match; + } test_cases[] = { + {SafeBrowsingJavaThreatType::SOCIAL_ENGINEERING, {}, {}}, + {SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION, + {}, + {{Type::ABUSIVE, Level::ENFORCE}}}, + {SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION, + {static_cast(SafeBrowsingJavaThreatAttribute::CANARY)}, + {{Type::ABUSIVE, Level::WARN}}}, + {SafeBrowsingJavaThreatType::ABUSIVE_EXPERIENCE_VIOLATION, + {static_cast(SafeBrowsingJavaThreatAttribute::FRAME_ONLY)}, + {{Type::ABUSIVE, Level::ENFORCE}}}, + {SafeBrowsingJavaThreatType::BETTER_ADS_VIOLATION, + {}, + {{Type::BETTER_ADS, Level::ENFORCE}}}, + {SafeBrowsingJavaThreatType::BETTER_ADS_VIOLATION, + {static_cast(SafeBrowsingJavaThreatAttribute::CANARY)}, + {{Type::BETTER_ADS, Level::WARN}}}, + {SafeBrowsingJavaThreatType::BETTER_ADS_VIOLATION, + {static_cast(SafeBrowsingJavaThreatAttribute::FRAME_ONLY)}, + {{Type::BETTER_ADS, Level::ENFORCE}}}}; + + for (const auto& test_case : test_cases) { + ThreatMetadata metadata = GetThreatMetadataFromSafeBrowsingApi( + test_case.threat_type, test_case.threat_attributes); + ThreatMetadata expected; + expected.subresource_filter_match = test_case.expected_match; + EXPECT_EQ(expected, metadata); + } +} + } // namespace safe_browsing diff --git a/components/safe_browsing/core/common/features.cc b/components/safe_browsing/core/common/features.cc index f3e51b28d5e859..86c21a2f2e4ca3 100644 --- a/components/safe_browsing/core/common/features.cc +++ b/components/safe_browsing/core/common/features.cc @@ -254,6 +254,10 @@ const base::FeatureParam kUrlLevelValidationForHprtExperimentEnabled{ BASE_FEATURE(kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck, "SafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck", base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE(kSafeBrowsingNewGmsApiForSubresourceFilterCheck, + "SafeBrowsingNewGmsApiForSubresourceFilterCheck", + base::FEATURE_DISABLED_BY_DEFAULT); #endif BASE_FEATURE(kSafeBrowsingOnUIThread, diff --git a/components/safe_browsing/core/common/features.h b/components/safe_browsing/core/common/features.h index 24005f78a51a5e..b2e56a9ad34373 100644 --- a/components/safe_browsing/core/common/features.h +++ b/components/safe_browsing/core/common/features.h @@ -224,6 +224,9 @@ extern const base::FeatureParam #if BUILDFLAG(IS_ANDROID) // Use new GMSCore API for hash database check on browser URLs. BASE_DECLARE_FEATURE(kSafeBrowsingNewGmsApiForBrowseUrlDatabaseCheck); + +// Use new GMSCore API for subresource filter checks. +BASE_DECLARE_FEATURE(kSafeBrowsingNewGmsApiForSubresourceFilterCheck); #endif // Run Safe Browsing code on UI thread. diff --git a/tools/metrics/histograms/metadata/safe_browsing/enums.xml b/tools/metrics/histograms/metadata/safe_browsing/enums.xml index a4a7230fe493d8..11b6a25d1e58e6 100644 --- a/tools/metrics/histograms/metadata/safe_browsing/enums.xml +++ b/tools/metrics/histograms/metadata/safe_browsing/enums.xml @@ -237,8 +237,9 @@ chromium-metrics-reviews@google.com. - + +