add random seed

This commit is contained in:
Carmelo Messina
2020-12-01 16:52:31 +01:00
parent d4dd2dd63b
commit 95090b016d
+6 -5
View File
@@ -39,10 +39,10 @@ See also: https://github.com/bromite/bromite/wiki/TimezoneOverride
.../core/common/content_settings_types.h | 3 +
.../core/common/pref_names.cc | 3 +
.../content_settings/core/common/pref_names.h | 2 +
.../renderer/content_settings_agent_impl.cc | 88 ++++++++
.../renderer/content_settings_agent_impl.cc | 89 ++++++++
.../renderer/content_settings_agent_impl.h | 4 +
.../WebLayerSiteSettingsClient.java | 3 +
36 files changed, 713 insertions(+), 10 deletions(-)
36 files changed, 714 insertions(+), 10 deletions(-)
create mode 100755 components/browser_ui/site_settings/android/java/res/layout/time_zone_select_dialog.xml
create mode 100755 components/browser_ui/site_settings/android/java/res/layout/timezoneoverride_site_settings_preference.xml
create mode 100755 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TimezoneOverrideSiteSettingsPreference.java
@@ -1142,7 +1142,7 @@ diff --git a/components/content_settings/core/common/content_settings_mojom_trai
data.ReadPopupRedirectRules(&out->popup_redirect_rules) &&
- data.ReadMixedContentRules(&out->mixed_content_rules);
+ data.ReadMixedContentRules(&out->mixed_content_rules) &&
+ data.ReadTimezoneOverrideRules(&out->timezone_override_rules) &&
+ data.ReadTimezoneOverrideRules(&out->timezone_override_rules) &&
+ data.ReadTimezoneOverrideValue(&out->timezone_override_value);
}
@@ -1245,7 +1245,7 @@ diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc
return allow;
}
@@ -509,4 +520,81 @@ bool ContentSettingsAgentImpl::IsWhitelistedForContentSettings() const {
@@ -509,4 +520,82 @@ bool ContentSettingsAgentImpl::IsWhitelistedForContentSettings() const {
return false;
}
@@ -1287,7 +1287,8 @@ diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc
+ } else if (setting == CONTENT_SETTING_BLOCK) {
+ // timezone random
+ UErrorCode ec = U_ZERO_ERROR;
+ int32_t rawOffset = ((rand() % 24) - 12) * 3600 * 1000;
+ std::srand(std::time(nullptr));
+ int32_t rawOffset = ((std::rand() % 24) - 12) * 3600 * 1000;
+ icu::StringEnumeration* timezones = icu::TimeZone::createEnumeration(
+ rawOffset); // Obtain timezones by GMT timezone offset
+ if (timezones) {