Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: src/extensions/i18n/i18n-utils.js

Issue 22715004: Version 3.20.15 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Add TypedArray API and correctness patches r16033 and r16084 Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/extensions/i18n/i18n-utils.cc ('k') | src/extensions/i18n/locale.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/extensions/i18n/i18n-utils.js
diff --git a/src/extensions/i18n/i18n-utils.js b/src/extensions/i18n/i18n-utils.js
index 545082ecbba4d6ba9755c9639234a28ba4889cf5..d7e9486c507681c73973fb25e9bb7a39198cfc21 100644
--- a/src/extensions/i18n/i18n-utils.js
+++ b/src/extensions/i18n/i18n-utils.js
@@ -255,6 +255,8 @@ function resolveLocale(service, requestedLocales, options) {
* lookup algorithm.
*/
function lookupMatcher(service, requestedLocales) {
+ native function NativeJSGetDefaultICULocale();
+
if (service.match(SERVICE_RE) === null) {
throw new Error('Internal error, wrong service type: ' + service);
}
@@ -285,7 +287,7 @@ function lookupMatcher(service, requestedLocales) {
// Didn't find a match, return default.
if (DEFAULT_ICU_LOCALE === undefined) {
- DEFAULT_ICU_LOCALE = %GetDefaultICULocale();
+ DEFAULT_ICU_LOCALE = NativeJSGetDefaultICULocale();
}
return {'locale': DEFAULT_ICU_LOCALE, 'extension': '', 'position': -1};
@@ -444,12 +446,14 @@ function getOptimalLanguageTag(original, resolved) {
// Returns Array<Object>, where each object has maximized and base properties.
// Maximized: zh -> zh-Hans-CN
// Base: zh-CN-u-ca-gregory -> zh-CN
+ native function NativeJSGetLanguageTagVariants();
+
// Take care of grandfathered or simple cases.
if (original === resolved) {
return original;
}
- var locales = %GetLanguageTagVariants([original, resolved]);
+ var locales = NativeJSGetLanguageTagVariants([original, resolved]);
if (locales[0].maximized !== locales[1].maximized) {
return resolved;
}
@@ -467,7 +471,8 @@ function getOptimalLanguageTag(original, resolved) {
* that is supported. This is required by the spec.
*/
function getAvailableLocalesOf(service) {
- var available = %AvailableLocalesOf(service);
+ native function NativeJSAvailableLocalesOf();
+ var available = NativeJSAvailableLocalesOf(service);
for (var i in available) {
if (available.hasOwnProperty(i)) {
« no previous file with comments | « src/extensions/i18n/i18n-utils.cc ('k') | src/extensions/i18n/locale.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698