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

Side by Side Diff: src/i18n.cc

Issue 22432009: Don't use Persistent in runtime (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates 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/i18n.h ('k') | src/runtime.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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 *isolate->factory()->NewStringFromAscii(CStrVector("dateFormat")))) { 790 *isolate->factory()->NewStringFromAscii(CStrVector("dateFormat")))) {
791 return reinterpret_cast<icu::SimpleDateFormat*>( 791 return reinterpret_cast<icu::SimpleDateFormat*>(
792 obj->GetInternalField(0)); 792 obj->GetInternalField(0));
793 } 793 }
794 794
795 return NULL; 795 return NULL;
796 } 796 }
797 797
798 798
799 void DateFormat::DeleteDateFormat(v8::Isolate* isolate, 799 void DateFormat::DeleteDateFormat(v8::Isolate* isolate,
800 Persistent<v8::Object>* object, 800 Persistent<v8::Value>* object,
801 void* param) { 801 void* param) {
802 // First delete the hidden C++ object. 802 // First delete the hidden C++ object.
803 delete reinterpret_cast<icu::SimpleDateFormat*>(Handle<JSObject>::cast( 803 delete reinterpret_cast<icu::SimpleDateFormat*>(Handle<JSObject>::cast(
804 v8::Utils::OpenPersistent(object))->GetInternalField(0)); 804 v8::Utils::OpenPersistent(object))->GetInternalField(0));
805 805
806 // Then dispose of the persistent handle to JS object. 806 // Then dispose of the persistent handle to JS object.
807 object->Dispose(isolate); 807 object->Dispose(isolate);
808 } 808 }
809 809
810 810
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 if (obj->HasLocalProperty(*isolate->factory()->NewStringFromAscii( 853 if (obj->HasLocalProperty(*isolate->factory()->NewStringFromAscii(
854 CStrVector("numberFormat")))) { 854 CStrVector("numberFormat")))) {
855 return reinterpret_cast<icu::DecimalFormat*>(obj->GetInternalField(0)); 855 return reinterpret_cast<icu::DecimalFormat*>(obj->GetInternalField(0));
856 } 856 }
857 857
858 return NULL; 858 return NULL;
859 } 859 }
860 860
861 861
862 void NumberFormat::DeleteNumberFormat(v8::Isolate* isolate, 862 void NumberFormat::DeleteNumberFormat(v8::Isolate* isolate,
863 Persistent<v8::Object>* object, 863 Persistent<v8::Value>* object,
864 void* param) { 864 void* param) {
865 // First delete the hidden C++ object. 865 // First delete the hidden C++ object.
866 delete reinterpret_cast<icu::DecimalFormat*>(Handle<JSObject>::cast( 866 delete reinterpret_cast<icu::DecimalFormat*>(Handle<JSObject>::cast(
867 v8::Utils::OpenPersistent(object))->GetInternalField(0)); 867 v8::Utils::OpenPersistent(object))->GetInternalField(0));
868 868
869 // Then dispose of the persistent handle to JS object. 869 // Then dispose of the persistent handle to JS object.
870 object->Dispose(isolate); 870 object->Dispose(isolate);
871 } 871 }
872 872
873 873
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 if (obj->HasLocalProperty(*isolate->factory()->NewStringFromAscii( 913 if (obj->HasLocalProperty(*isolate->factory()->NewStringFromAscii(
914 CStrVector("collator")))) { 914 CStrVector("collator")))) {
915 return reinterpret_cast<icu::Collator*>(obj->GetInternalField(0)); 915 return reinterpret_cast<icu::Collator*>(obj->GetInternalField(0));
916 } 916 }
917 917
918 return NULL; 918 return NULL;
919 } 919 }
920 920
921 921
922 void Collator::DeleteCollator(v8::Isolate* isolate, 922 void Collator::DeleteCollator(v8::Isolate* isolate,
923 Persistent<v8::Object>* object, 923 Persistent<v8::Value>* object,
924 void* param) { 924 void* param) {
925 // First delete the hidden C++ object. 925 // First delete the hidden C++ object.
926 delete reinterpret_cast<icu::Collator*>(Handle<JSObject>::cast( 926 delete reinterpret_cast<icu::Collator*>(Handle<JSObject>::cast(
927 v8::Utils::OpenPersistent(object))->GetInternalField(0)); 927 v8::Utils::OpenPersistent(object))->GetInternalField(0));
928 928
929 // Then dispose of the persistent handle to JS object. 929 // Then dispose of the persistent handle to JS object.
930 object->Dispose(isolate); 930 object->Dispose(isolate);
931 } 931 }
932 932
933 } } // namespace v8::internal 933 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/i18n.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698