OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 | 827 |
828 /** | 828 /** |
829 * Creates a new external string using the data defined in the given | 829 * Creates a new external string using the data defined in the given |
830 * resource. The resource is deleted when the external string is no | 830 * resource. The resource is deleted when the external string is no |
831 * longer live on V8's heap. The caller of this function should not | 831 * longer live on V8's heap. The caller of this function should not |
832 * delete or modify the resource. Neither should the underlying buffer be | 832 * delete or modify the resource. Neither should the underlying buffer be |
833 * deallocated or modified except through the destructor of the | 833 * deallocated or modified except through the destructor of the |
834 * external string resource. | 834 * external string resource. |
835 */ | 835 */ |
836 static Local<String> NewExternal(ExternalStringResource* resource); | 836 static Local<String> NewExternal(ExternalStringResource* resource); |
| 837 |
| 838 /** |
| 839 * Associate an external string resource with this string by transforming it |
| 840 * in place so that existing references to this string in the JavaScript heap |
| 841 * will use the external string resource. The external string resource's |
| 842 * character contents needs to be equivalent to this string. |
| 843 * Returns true if the string has been changed to be an external string. |
| 844 * The string is not modified if the operation fails. |
| 845 */ |
| 846 bool MakeExternal(ExternalStringResource* resource); |
837 | 847 |
838 /** | 848 /** |
839 * Creates a new external string using the ascii data defined in the given | 849 * Creates a new external string using the ascii data defined in the given |
840 * resource. The resource is deleted when the external string is no | 850 * resource. The resource is deleted when the external string is no |
841 * longer live on V8's heap. The caller of this function should not | 851 * longer live on V8's heap. The caller of this function should not |
842 * delete or modify the resource. Neither should the underlying buffer be | 852 * delete or modify the resource. Neither should the underlying buffer be |
843 * deallocated or modified except through the destructor of the | 853 * deallocated or modified except through the destructor of the |
844 * external string resource. | 854 * external string resource. |
845 */ | 855 */ |
846 static Local<String> NewExternal(ExternalAsciiStringResource* resource); | 856 static Local<String> NewExternal(ExternalAsciiStringResource* resource); |
| 857 |
| 858 /** |
| 859 * Associate an external string resource with this string by transforming it |
| 860 * in place so that existing references to this string in the JavaScript heap |
| 861 * will use the external string resource. The external string resource's |
| 862 * character contents needs to be equivalent to this string. |
| 863 * Returns true if the string has been changed to be an external string. |
| 864 * The string is not modified if the operation fails. |
| 865 */ |
| 866 bool MakeExternal(ExternalAsciiStringResource* resource); |
847 | 867 |
848 /** Creates an undetectable string from the supplied ascii or utf-8 data.*/ | 868 /** Creates an undetectable string from the supplied ascii or utf-8 data.*/ |
849 static Local<String> NewUndetectable(const char* data, int length = -1); | 869 static Local<String> NewUndetectable(const char* data, int length = -1); |
850 | 870 |
851 /** Creates an undetectable string from the supplied utf-16 data.*/ | 871 /** Creates an undetectable string from the supplied utf-16 data.*/ |
852 static Local<String> NewUndetectable(const uint16_t* data, int length = -1); | 872 static Local<String> NewUndetectable(const uint16_t* data, int length = -1); |
853 | 873 |
854 /** | 874 /** |
855 * Converts an object to a utf8-encoded character array. Useful if | 875 * Converts an object to a utf8-encoded character array. Useful if |
856 * you want to print the object. | 876 * you want to print the object. |
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2463 | 2483 |
2464 } // namespace v8 | 2484 } // namespace v8 |
2465 | 2485 |
2466 | 2486 |
2467 #undef EXPORT | 2487 #undef EXPORT |
2468 #undef EXPORT_INLINE | 2488 #undef EXPORT_INLINE |
2469 #undef TYPE_CHECK | 2489 #undef TYPE_CHECK |
2470 | 2490 |
2471 | 2491 |
2472 #endif // V8_H_ | 2492 #endif // V8_H_ |
OLD | NEW |