Turn off newly added Canonicalization

ICU 67.1 migration caused 30ms startup performance regression because
the new code to implement UTS35 Locale ID Canonicalization
https://github.com/unicode-org/icu/pull/951
(but later prove incomplete due to UTS35 / CLDR spec inconsistency
issue) use ures_openDirect and "the increased time is likely due to
increased paging in ICU data from disk on cold start."

To help relanding the ICU67.1 ASAP without risking the startup
performance regression, #ifdef 0 out that part of code (in PR 951).
This is a temp fix to make other part of the chrome to use ICU67.1 (for
example new timezone update) w/o the startup regression.

Bug: 1080367
Change-Id: Ia3c4acfa0782705d7cccb4e2c32541c747ea7bd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2220773
Reviewed-by: Frank Tang <ftang@chromium.org>
diff --git a/README.chromium b/README.chromium
index 30b85d3..a722026 100644
--- a/README.chromium
+++ b/README.chromium
@@ -227,3 +227,10 @@
 7. Enable tracing of file but not resource, only for Chromium
     to reduce performance impact/risk.
   - patches/restrace.patch
+
+8. #if 0 new code in Locale::createCanonical which added in
+   https://github.com/unicode-org/icu/pull/951 that use ures and caused
+   30ms startup performance regression.
+  - patches/turnOffNewCodeInLocaleCanonical.patch
+  - upstream bug:
+    https://unicode-org.atlassian.net/browse/ICU-21139
diff --git a/patches/turnOffNewCodeInLocaleCanonical.patch b/patches/turnOffNewCodeInLocaleCanonical.patch
new file mode 100644
index 0000000..70aa7c0
--- /dev/null
+++ b/patches/turnOffNewCodeInLocaleCanonical.patch
@@ -0,0 +1,36 @@
+diff --git a/source/common/locid.cpp b/source/common/locid.cpp
+index 753a4521..7c01b05b 100644
+--- a/source/common/locid.cpp
++++ b/source/common/locid.cpp
+@@ -508,6 +508,7 @@ Locale::operator==( const   Locale& other) const
+ 
+ #define ISASCIIALPHA(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z'))
+ 
++#if 0  // TURN OFF the new part of UTS35 Locale Canonicalization due to start up performance regression
+ namespace {
+ 
+ CharString& AppendLSCVE(CharString& out, const char* language, const char* script,
+@@ -537,6 +538,7 @@ CharString& AppendLSCVE(CharString& out, const char* language, const char* scrip
+ }
+ 
+ }  // namespace
++#endif
+ 
+ /*This function initializes a Locale from a C locale ID*/
+ Locale& Locale::init(const char* localeID, UBool canonicalize)
+@@ -661,6 +663,7 @@ Locale& Locale::init(const char* localeID, UBool canonicalize)
+             break;
+         }
+ 
++#if 0  // TURN OFF the new part of UTS35 Locale Canonicalization due to start up performance regression
+         if (canonicalize) {
+             UErrorCode status = U_ZERO_ERROR;
+             // TODO: Try to use ResourceDataValue and ures_getValueWithFallback() etc.
+@@ -849,6 +852,7 @@ Locale& Locale::init(const char* localeID, UBool canonicalize)
+                 }   // End of handle REGION
+             } while (0);
+         }   // if (canonicalize) {
++#endif
+ 
+         // successful end of init()
+         return *this;
diff --git a/source/common/locid.cpp b/source/common/locid.cpp
index 753a452..7c01b05 100644
--- a/source/common/locid.cpp
+++ b/source/common/locid.cpp
@@ -508,6 +508,7 @@
 
 #define ISASCIIALPHA(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z'))
 
+#if 0  // TURN OFF the new part of UTS35 Locale Canonicalization due to start up performance regression
 namespace {
 
 CharString& AppendLSCVE(CharString& out, const char* language, const char* script,
@@ -537,6 +538,7 @@
 }
 
 }  // namespace
+#endif
 
 /*This function initializes a Locale from a C locale ID*/
 Locale& Locale::init(const char* localeID, UBool canonicalize)
@@ -661,6 +663,7 @@
             break;
         }
 
+#if 0  // TURN OFF the new part of UTS35 Locale Canonicalization due to start up performance regression
         if (canonicalize) {
             UErrorCode status = U_ZERO_ERROR;
             // TODO: Try to use ResourceDataValue and ures_getValueWithFallback() etc.
@@ -849,6 +852,7 @@
                 }   // End of handle REGION
             } while (0);
         }   // if (canonicalize) {
+#endif
 
         // successful end of init()
         return *this;