| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 | 4 |
| 5 #include "src/extensions/externalize-string-extension.h" | 5 #include "src/extensions/externalize-string-extension.h" |
| 6 | 6 |
| 7 #include "src/api.h" |
| 8 #include "src/handles.h" |
| 9 #include "src/isolate.h" |
| 10 |
| 7 namespace v8 { | 11 namespace v8 { |
| 8 namespace internal { | 12 namespace internal { |
| 9 | 13 |
| 10 template <typename Char, typename Base> | 14 template <typename Char, typename Base> |
| 11 class SimpleStringResource : public Base { | 15 class SimpleStringResource : public Base { |
| 12 public: | 16 public: |
| 13 // Takes ownership of |data|. | 17 // Takes ownership of |data|. |
| 14 SimpleStringResource(Char* data, size_t length) | 18 SimpleStringResource(Char* data, size_t length) |
| 15 : data_(data), | 19 : data_(data), |
| 16 length_(length) {} | 20 length_(length) {} |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 NewStringType::kNormal).ToLocalChecked()); | 133 NewStringType::kNormal).ToLocalChecked()); |
| 130 return; | 134 return; |
| 131 } | 135 } |
| 132 bool is_one_byte = | 136 bool is_one_byte = |
| 133 Utils::OpenHandle(*args[0].As<v8::String>())->IsOneByteRepresentation(); | 137 Utils::OpenHandle(*args[0].As<v8::String>())->IsOneByteRepresentation(); |
| 134 args.GetReturnValue().Set(is_one_byte); | 138 args.GetReturnValue().Set(is_one_byte); |
| 135 } | 139 } |
| 136 | 140 |
| 137 } // namespace internal | 141 } // namespace internal |
| 138 } // namespace v8 | 142 } // namespace v8 |
| OLD | NEW |