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

Unified Diff: src/i18n.h

Issue 22411003: Move i18n extension's date-format C++ code to runtime (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase 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-extension.cc ('k') | src/i18n.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/i18n.h
diff --git a/src/extensions/i18n/date-format.h b/src/i18n.h
similarity index 69%
rename from src/extensions/i18n/date-format.h
rename to src/i18n.h
index daa5964e254519faa7a8eef7d7a5d375562bc0ed..37c57b135bfb3626112044eb207d8221fbb51cbb 100644
--- a/src/extensions/i18n/date-format.h
+++ b/src/i18n.h
@@ -26,8 +26,8 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// limitations under the License.
-#ifndef V8_EXTENSIONS_I18N_DATE_FORMAT_H_
-#define V8_EXTENSIONS_I18N_DATE_FORMAT_H_
+#ifndef V8_I18N_H_
+#define V8_I18N_H_
#include "unicode/uversion.h"
#include "v8.h"
@@ -36,36 +36,44 @@ namespace U_ICU_NAMESPACE {
class SimpleDateFormat;
}
-namespace v8_i18n {
+namespace v8 {
+namespace internal {
-class DateFormat {
+class I18N {
public:
- static void JSCreateDateTimeFormat(
- const v8::FunctionCallbackInfo<v8::Value>& args);
+ // Creates an ObjectTemplate with one internal field.
+ static Handle<ObjectTemplateInfo> GetTemplate(Isolate* isolate);
+
+ // Creates an ObjectTemplate with two internal fields.
+ static Handle<ObjectTemplateInfo> GetTemplate2(Isolate* isolate);
+
+ private:
+ I18N();
+};
- // Helper methods for various bindings.
+class DateFormat {
+ public:
+ // Create a formatter for the specificied locale and options. Returns the
+ // resolved settings for the locale / options.
+ static icu::SimpleDateFormat* InitializeDateTimeFormat(
+ Isolate* isolate,
+ Handle<String> locale,
+ Handle<JSObject> options,
+ Handle<JSObject> resolved);
// Unpacks date format object from corresponding JavaScript object.
- static icu::SimpleDateFormat* UnpackDateFormat(
- v8::Handle<v8::Object> obj);
+ static icu::SimpleDateFormat* UnpackDateFormat(Isolate* isolate,
+ Handle<JSObject> obj);
// Release memory we allocated for the DateFormat once the JS object that
// holds the pointer gets garbage collected.
static void DeleteDateFormat(v8::Isolate* isolate,
- v8::Persistent<v8::Object>* object,
+ Persistent<v8::Object>* object,
void* param);
-
- // Formats date and returns corresponding string.
- static void JSInternalFormat(const v8::FunctionCallbackInfo<v8::Value>& args);
-
- // Parses date and returns corresponding Date object or undefined if parse
- // failed.
- static void JSInternalParse(const v8::FunctionCallbackInfo<v8::Value>& args);
-
private:
DateFormat();
};
-} // namespace v8_i18n
+} } // namespace v8::internal
-#endif // V8_EXTENSIONS_I18N_DATE_FORMAT_H_
+#endif // V8_I18N_H_
« 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