summarylogtreecommitdiffstats
path: root/0005-Revert-Trace-ICU-object-creation-in-ICU.CreateInstan.patch
diff options
context:
space:
mode:
Diffstat (limited to '0005-Revert-Trace-ICU-object-creation-in-ICU.CreateInstan.patch')
-rw-r--r--0005-Revert-Trace-ICU-object-creation-in-ICU.CreateInstan.patch199
1 files changed, 0 insertions, 199 deletions
diff --git a/0005-Revert-Trace-ICU-object-creation-in-ICU.CreateInstan.patch b/0005-Revert-Trace-ICU-object-creation-in-ICU.CreateInstan.patch
deleted file mode 100644
index bf89b54beef..00000000000
--- a/0005-Revert-Trace-ICU-object-creation-in-ICU.CreateInstan.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-From 9c5607e39aaf34f866ca2b815196953ec3818098 Mon Sep 17 00:00:00 2001
-From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com>
-Date: Sat, 11 Apr 2020 12:32:25 +1000
-Subject: [PATCH 5/8] Revert "Trace ICU object creation in "ICU.CreateInstance"
- UMA histogram"
-
-This reverts commit 928bcad29884064f83bf05ecadf82369f8b4622f.
----
- DEPS | 2 +-
- base/i18n/icu_util.cc | 150 +++++++-----------------------------------
- 2 files changed, 25 insertions(+), 127 deletions(-)
-
-diff --git a/DEPS b/DEPS
-index 95ff15cbf88c..fd23a935909f 100644
---- a/DEPS
-+++ b/DEPS
-@@ -1014,7 +1014,7 @@ deps = {
- Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + '6fdad5388130757e1efb58a14b8e7f9494625691',
-
- 'src/third_party/icu':
-- Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '13cfcd5874f6c39c34ec57fa5295e7910ae90b8d',
-+ Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'd7aff76cf6bb0fbef3afa6c07718f78a80a70f8f',
-
- 'src/third_party/icu4j': {
- 'packages': [
-diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc
-index 82022d5f490e..425a0b2a6648 100644
---- a/base/i18n/icu_util.cc
-+++ b/base/i18n/icu_util.cc
-@@ -350,134 +350,32 @@ void InitializeIcuTimeZone() {
- }
-
- const char kICUDataFile[] = "ICU.DataFile";
--const char kICUCreateInstance[] = "ICU.CreateInstance";
--
--enum class ICUCreateInstance {
-- kCharacterBreakIterator = 0,
-- kWordBreakIterator = 1,
-- kLineBreakIterator = 2,
-- kLineBreakIteratorTypeLoose = 3,
-- kLineBreakIteratorTypeNormal = 4,
-- kLineBreakIteratorTypeStrict = 5,
-- kSentenceBreakIterator = 6,
-- kTitleBreakIterator = 7,
-- kThaiBreakEngine = 8,
-- kLaoBreakEngine = 9,
-- kBurmeseBreakEngine = 10,
-- kKhmerBreakEngine = 11,
-- kChineseJapaneseBreakEngine = 12,
--
-- kMaxValue = kChineseJapaneseBreakEngine
--};
--
--// Callback functions to report the opening of ICU Data File, and creation of
--// key objects to UMA. This help us to understand what built-in ICU data files
--// are rarely used in the user's machines and the distribution of ICU usage.
--static void U_CALLCONV TraceICUEntry(const void*, int32_t fn_number) {
-- switch (fn_number) {
-- case UTRACE_UBRK_CREATE_CHARACTER:
-- base::UmaHistogramEnumeration(kICUCreateInstance,
-- ICUCreateInstance::kCharacterBreakIterator);
-- break;
-- case UTRACE_UBRK_CREATE_SENTENCE:
-- base::UmaHistogramEnumeration(kICUCreateInstance,
-- ICUCreateInstance::kSentenceBreakIterator);
-- break;
-- case UTRACE_UBRK_CREATE_TITLE:
-- base::UmaHistogramEnumeration(kICUCreateInstance,
-- ICUCreateInstance::kTitleBreakIterator);
-- break;
-- case UTRACE_UBRK_CREATE_WORD:
-- base::UmaHistogramEnumeration(kICUCreateInstance,
-- ICUCreateInstance::kWordBreakIterator);
-- break;
-- default:
-- return;
-- }
--}
-
--static void U_CALLCONV TraceICUData(const void* context,
-- int32_t fn_number,
-- int32_t level,
-- const char* fmt,
-- va_list args) {
-- switch (fn_number) {
-- case UTRACE_UDATA_DATA_FILE: {
-- std::string icu_data_file_name(va_arg(args, const char*));
-- va_end(args);
-- // Skip icu version specified prefix if exist.
-- // path is prefixed with icu version prefix such as "icudt65l-".
-- // Histogram only the part after the -.
-- if (icu_data_file_name.find("icudt") == 0) {
-- size_t dash = icu_data_file_name.find("-");
-- if (dash != std::string::npos) {
-- icu_data_file_name = icu_data_file_name.substr(dash + 1);
-- }
-- }
-- // UmaHistogramSparse should track less than 100 values.
-- // We currently have about total 55 built-in data files inside ICU
-- // so it fit the UmaHistogramSparse usage.
-- int hash = base::HashMetricName(icu_data_file_name);
-- base::UmaHistogramSparse(kICUDataFile, hash);
-- return;
-- }
-- case UTRACE_UBRK_CREATE_LINE: {
-- const char* lb_type = va_arg(args, const char*);
-- va_end(args);
-- ICUCreateInstance value;
-- switch (lb_type[0]) {
-- case '\0':
-- value = ICUCreateInstance::kLineBreakIterator;
-- break;
-- case 'l':
-- DCHECK(strcmp(lb_type, "loose") == 0);
-- value = ICUCreateInstance::kLineBreakIteratorTypeLoose;
-- break;
-- case 'n':
-- DCHECK(strcmp(lb_type, "normal") == 0);
-- value = ICUCreateInstance::kLineBreakIteratorTypeNormal;
-- break;
-- case 's':
-- DCHECK(strcmp(lb_type, "strict") == 0);
-- value = ICUCreateInstance::kLineBreakIteratorTypeStrict;
-- break;
-- default:
-- return;
-- }
-- base::UmaHistogramEnumeration(kICUCreateInstance, value);
-- return;
-- }
-- case UTRACE_UBRK_CREATE_BREAK_ENGINE: {
-- const char* script = va_arg(args, const char*);
-- va_end(args);
-- ICUCreateInstance value;
-- switch (script[0]) {
-- case 'H':
-- DCHECK(strcmp(script, "Hani") == 0);
-- value = ICUCreateInstance::kChineseJapaneseBreakEngine;
-- break;
-- case 'K':
-- DCHECK(strcmp(script, "Khmr") == 0);
-- value = ICUCreateInstance::kKhmerBreakEngine;
-- break;
-- case 'L':
-- DCHECK(strcmp(script, "Laoo") == 0);
-- value = ICUCreateInstance::kLaoBreakEngine;
-- break;
-- case 'M':
-- DCHECK(strcmp(script, "Mymr") == 0);
-- value = ICUCreateInstance::kBurmeseBreakEngine;
-- break;
-- case 'T':
-- DCHECK(strcmp(script, "Thai") == 0);
-- value = ICUCreateInstance::kThaiBreakEngine;
-- break;
-- default:
-- return;
-+// Callback function to report the opening of ICU Data File to UMA.
-+// This help us to understand what built-in ICU data files are rarely used
-+// in the user's machines.
-+static void U_CALLCONV TraceICUDataFile(const void* context,
-+ int32_t fn_number,
-+ int32_t level,
-+ const char* fmt,
-+ va_list args) {
-+ if (fn_number == UTRACE_UDATA_DATA_FILE) {
-+ std::string icu_data_file_name(va_arg(args, const char*));
-+ va_end(args);
-+ // Skip icu version specified prefix if exist.
-+ // path is prefixed with icu version prefix such as "icudt65l-".
-+ // Histogram only the part after the -.
-+ if (icu_data_file_name.find("icudt") == 0) {
-+ size_t dash = icu_data_file_name.find("-");
-+ if (dash != std::string::npos) {
-+ icu_data_file_name = icu_data_file_name.substr(dash + 1);
- }
-- base::UmaHistogramEnumeration(kICUCreateInstance, value);
-- return;
- }
-+ // UmaHistogramSparse should track less than 100 values.
-+ // We currently have about total 55 built-in data files inside ICU
-+ // so it fit the UmaHistogramSparse usage.
-+ int hash = base::HashMetricName(icu_data_file_name);
-+ base::UmaHistogramSparse(kICUDataFile, hash);
- }
- }
-
-@@ -491,7 +389,7 @@ bool DoCommonInitialization() {
- InitializeIcuTimeZone();
-
- const void* context = nullptr;
-- utrace_setFunctions(context, TraceICUEntry, nullptr, TraceICUData);
-+ utrace_setFunctions(context, nullptr, nullptr, TraceICUDataFile);
- utrace_setLevel(UTRACE_VERBOSE);
- return true;
- }
---
-2.26.1
-