OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // limitations under the License. | 4 // limitations under the License. |
5 | 5 |
6 #include "src/i18n.h" | 6 #include "src/i18n.h" |
7 | 7 |
8 #include "unicode/brkiter.h" | 8 #include "unicode/brkiter.h" |
9 #include "unicode/calendar.h" | 9 #include "unicode/calendar.h" |
10 #include "unicode/coll.h" | 10 #include "unicode/coll.h" |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 // Defualt is word iterator. | 624 // Defualt is word iterator. |
625 break_iterator = | 625 break_iterator = |
626 icu::BreakIterator::createWordInstance(icu_locale, status); | 626 icu::BreakIterator::createWordInstance(icu_locale, status); |
627 } | 627 } |
628 | 628 |
629 if (U_FAILURE(status)) { | 629 if (U_FAILURE(status)) { |
630 delete break_iterator; | 630 delete break_iterator; |
631 return NULL; | 631 return NULL; |
632 } | 632 } |
633 | 633 |
634 isolate->CountUsage(v8::Isolate::UseCounterFeature::kBreakIterator); | |
635 | |
636 return break_iterator; | 634 return break_iterator; |
637 } | 635 } |
638 | 636 |
639 | 637 |
640 void SetResolvedBreakIteratorSettings(Isolate* isolate, | 638 void SetResolvedBreakIteratorSettings(Isolate* isolate, |
641 const icu::Locale& icu_locale, | 639 const icu::Locale& icu_locale, |
642 icu::BreakIterator* break_iterator, | 640 icu::BreakIterator* break_iterator, |
643 Handle<JSObject> resolved) { | 641 Handle<JSObject> resolved) { |
644 Factory* factory = isolate->factory(); | 642 Factory* factory = isolate->factory(); |
645 UErrorCode status = U_ZERO_ERROR; | 643 UErrorCode status = U_ZERO_ERROR; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 | 923 |
926 | 924 |
927 void BreakIterator::DeleteBreakIterator( | 925 void BreakIterator::DeleteBreakIterator( |
928 const v8::WeakCallbackData<v8::Value, void>& data) { | 926 const v8::WeakCallbackData<v8::Value, void>& data) { |
929 DeleteNativeObjectAt<icu::BreakIterator>(data, 0); | 927 DeleteNativeObjectAt<icu::BreakIterator>(data, 0); |
930 DeleteNativeObjectAt<icu::UnicodeString>(data, 1); | 928 DeleteNativeObjectAt<icu::UnicodeString>(data, 1); |
931 DestroyGlobalHandle(data); | 929 DestroyGlobalHandle(data); |
932 } | 930 } |
933 | 931 |
934 } } // namespace v8::internal | 932 } } // namespace v8::internal |
OLD | NEW |