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

Side by Side Diff: src/i18n.h

Issue 22671002: Move i18n collator code to runtime. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/extensions/i18n/i18n-extension.cc ('k') | src/i18n.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 15 matching lines...) Expand all
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 // limitations under the License. 27 // limitations under the License.
28 28
29 #ifndef V8_I18N_H_ 29 #ifndef V8_I18N_H_
30 #define V8_I18N_H_ 30 #define V8_I18N_H_
31 31
32 #include "unicode/uversion.h" 32 #include "unicode/uversion.h"
33 #include "v8.h" 33 #include "v8.h"
34 34
35 namespace U_ICU_NAMESPACE { 35 namespace U_ICU_NAMESPACE {
36 class Collator;
36 class DecimalFormat; 37 class DecimalFormat;
37 class SimpleDateFormat; 38 class SimpleDateFormat;
38 } 39 }
39 40
40 namespace v8 { 41 namespace v8 {
41 namespace internal { 42 namespace internal {
42 43
43 class I18N { 44 class I18N {
44 public: 45 public:
45 // Creates an ObjectTemplate with one internal field. 46 // Creates an ObjectTemplate with one internal field.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 94
94 // Release memory we allocated for the NumberFormat once the JS object that 95 // Release memory we allocated for the NumberFormat once the JS object that
95 // holds the pointer gets garbage collected. 96 // holds the pointer gets garbage collected.
96 static void DeleteNumberFormat(v8::Isolate* isolate, 97 static void DeleteNumberFormat(v8::Isolate* isolate,
97 Persistent<v8::Object>* object, 98 Persistent<v8::Object>* object,
98 void* param); 99 void* param);
99 private: 100 private:
100 NumberFormat(); 101 NumberFormat();
101 }; 102 };
102 103
104
105 class Collator {
106 public:
107 // Create a collator for the specificied locale and options. Returns the
108 // resolved settings for the locale / options.
109 static icu::Collator* InitializeCollator(
110 Isolate* isolate,
111 Handle<String> locale,
112 Handle<JSObject> options,
113 Handle<JSObject> resolved);
114
115 // Unpacks collator object from corresponding JavaScript object.
116 static icu::Collator* UnpackCollator(Isolate* isolate, Handle<JSObject> obj);
117
118 // Release memory we allocated for the Collator once the JS object that holds
119 // the pointer gets garbage collected.
120 static void DeleteCollator(v8::Isolate* isolate,
121 Persistent<v8::Object>* object,
122 void* param);
123 private:
124 Collator();
125 };
126
103 } } // namespace v8::internal 127 } } // namespace v8::internal
104 128
105 #endif // V8_I18N_H_ 129 #endif // V8_I18N_H_
OLDNEW
« no previous file with comments | « src/extensions/i18n/i18n-extension.cc ('k') | src/i18n.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698