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 |
634 return break_iterator; | 636 return break_iterator; |
635 } | 637 } |
636 | 638 |
637 | 639 |
638 void SetResolvedBreakIteratorSettings(Isolate* isolate, | 640 void SetResolvedBreakIteratorSettings(Isolate* isolate, |
639 const icu::Locale& icu_locale, | 641 const icu::Locale& icu_locale, |
640 icu::BreakIterator* break_iterator, | 642 icu::BreakIterator* break_iterator, |
641 Handle<JSObject> resolved) { | 643 Handle<JSObject> resolved) { |
642 Factory* factory = isolate->factory(); | 644 Factory* factory = isolate->factory(); |
643 UErrorCode status = U_ZERO_ERROR; | 645 UErrorCode status = U_ZERO_ERROR; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 | 925 |
924 | 926 |
925 void BreakIterator::DeleteBreakIterator( | 927 void BreakIterator::DeleteBreakIterator( |
926 const v8::WeakCallbackData<v8::Value, void>& data) { | 928 const v8::WeakCallbackData<v8::Value, void>& data) { |
927 DeleteNativeObjectAt<icu::BreakIterator>(data, 0); | 929 DeleteNativeObjectAt<icu::BreakIterator>(data, 0); |
928 DeleteNativeObjectAt<icu::UnicodeString>(data, 1); | 930 DeleteNativeObjectAt<icu::UnicodeString>(data, 1); |
929 DestroyGlobalHandle(data); | 931 DestroyGlobalHandle(data); |
930 } | 932 } |
931 | 933 |
932 } } // namespace v8::internal | 934 } } // namespace v8::internal |
OLD | NEW |