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

Unified Diff: src/i18n.cc

Issue 2601833002: [intl] Remove indirection in Intl objects (Closed)
Patch Set: Fix a dcheck Created 3 years, 11 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/i18n.h ('k') | src/js/i18n.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/i18n.cc
diff --git a/src/i18n.cc b/src/i18n.cc
index e1146ca3e75cb76b18ed23a054a519a4c97359d3..d2245ef34a9a319a53b4cf4b4ea05ec095fef2d5 100644
--- a/src/i18n.cc
+++ b/src/i18n.cc
@@ -225,23 +225,6 @@ void SetResolvedDateSettings(Isolate* isolate,
}
-template<int internal_fields, EternalHandles::SingletonHandle field>
-Handle<ObjectTemplateInfo> GetEternal(Isolate* isolate) {
- if (isolate->eternal_handles()->Exists(field)) {
- return Handle<ObjectTemplateInfo>::cast(
- isolate->eternal_handles()->GetSingleton(field));
- }
- v8::Local<v8::ObjectTemplate> raw_template =
- v8::ObjectTemplate::New(reinterpret_cast<v8::Isolate*>(isolate));
- raw_template->SetInternalFieldCount(internal_fields);
- return Handle<ObjectTemplateInfo>::cast(
- isolate->eternal_handles()->CreateSingleton(
- isolate,
- *v8::Utils::OpenHandle(*raw_template),
- field));
-}
-
-
icu::DecimalFormat* CreateICUNumberFormat(
Isolate* isolate,
const icu::Locale& icu_locale,
@@ -703,18 +686,6 @@ void SetResolvedBreakIteratorSettings(Isolate* isolate,
// static
-Handle<ObjectTemplateInfo> I18N::GetTemplate(Isolate* isolate) {
- return GetEternal<1, i::EternalHandles::I18N_TEMPLATE_ONE>(isolate);
-}
-
-
-// static
-Handle<ObjectTemplateInfo> I18N::GetTemplate2(Isolate* isolate) {
- return GetEternal<2, i::EternalHandles::I18N_TEMPLATE_TWO>(isolate);
-}
-
-
-// static
icu::SimpleDateFormat* DateFormat::InitializeDateTimeFormat(
Isolate* isolate,
Handle<String> locale,
@@ -875,11 +846,8 @@ void Collator::DeleteCollator(const v8::WeakCallbackInfo<void>& data) {
GlobalHandles::Destroy(reinterpret_cast<Object**>(data.GetParameter()));
}
-
-icu::BreakIterator* BreakIterator::InitializeBreakIterator(
- Isolate* isolate,
- Handle<String> locale,
- Handle<JSObject> options,
+icu::BreakIterator* V8BreakIterator::InitializeBreakIterator(
+ Isolate* isolate, Handle<String> locale, Handle<JSObject> options,
Handle<JSObject> resolved) {
// Convert BCP47 into ICU locale format.
UErrorCode status = U_ZERO_ERROR;
@@ -919,13 +887,12 @@ icu::BreakIterator* BreakIterator::InitializeBreakIterator(
return break_iterator;
}
-
-icu::BreakIterator* BreakIterator::UnpackBreakIterator(Isolate* isolate,
- Handle<JSObject> obj) {
+icu::BreakIterator* V8BreakIterator::UnpackBreakIterator(Isolate* isolate,
+ Handle<JSObject> obj) {
return reinterpret_cast<icu::BreakIterator*>(obj->GetInternalField(0));
}
-void BreakIterator::DeleteBreakIterator(
+void V8BreakIterator::DeleteBreakIterator(
const v8::WeakCallbackInfo<void>& data) {
delete reinterpret_cast<icu::BreakIterator*>(data.GetInternalField(0));
delete reinterpret_cast<icu::UnicodeString*>(data.GetInternalField(1));
« no previous file with comments | « src/i18n.h ('k') | src/js/i18n.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698