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

Side by Side Diff: src/extensions/externalize-string-extension.cc

Issue 1224623004: Make v8::Handle as "deprecated soon" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « src/extensions/externalize-string-extension.h ('k') | src/extensions/free-buffer-extension.h » ('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 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 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 9
10 template <typename Char, typename Base> 10 template <typename Char, typename Base>
(...skipping 19 matching lines...) Expand all
30 typedef SimpleStringResource<char, v8::String::ExternalOneByteStringResource> 30 typedef SimpleStringResource<char, v8::String::ExternalOneByteStringResource>
31 SimpleOneByteStringResource; 31 SimpleOneByteStringResource;
32 typedef SimpleStringResource<uc16, v8::String::ExternalStringResource> 32 typedef SimpleStringResource<uc16, v8::String::ExternalStringResource>
33 SimpleTwoByteStringResource; 33 SimpleTwoByteStringResource;
34 34
35 35
36 const char* const ExternalizeStringExtension::kSource = 36 const char* const ExternalizeStringExtension::kSource =
37 "native function externalizeString();" 37 "native function externalizeString();"
38 "native function isOneByteString();"; 38 "native function isOneByteString();";
39 39
40 v8::Handle<v8::FunctionTemplate> 40 v8::Local<v8::FunctionTemplate>
41 ExternalizeStringExtension::GetNativeFunctionTemplate( 41 ExternalizeStringExtension::GetNativeFunctionTemplate(
42 v8::Isolate* isolate, v8::Handle<v8::String> str) { 42 v8::Isolate* isolate, v8::Local<v8::String> str) {
43 if (strcmp(*v8::String::Utf8Value(str), "externalizeString") == 0) { 43 if (strcmp(*v8::String::Utf8Value(str), "externalizeString") == 0) {
44 return v8::FunctionTemplate::New(isolate, 44 return v8::FunctionTemplate::New(isolate,
45 ExternalizeStringExtension::Externalize); 45 ExternalizeStringExtension::Externalize);
46 } else { 46 } else {
47 DCHECK(strcmp(*v8::String::Utf8Value(str), "isOneByteString") == 0); 47 DCHECK(strcmp(*v8::String::Utf8Value(str), "isOneByteString") == 0);
48 return v8::FunctionTemplate::New(isolate, 48 return v8::FunctionTemplate::New(isolate,
49 ExternalizeStringExtension::IsOneByte); 49 ExternalizeStringExtension::IsOneByte);
50 } 50 }
51 } 51 }
52 52
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 NewStringType::kNormal).ToLocalChecked()); 129 NewStringType::kNormal).ToLocalChecked());
130 return; 130 return;
131 } 131 }
132 bool is_one_byte = 132 bool is_one_byte =
133 Utils::OpenHandle(*args[0].As<v8::String>())->IsOneByteRepresentation(); 133 Utils::OpenHandle(*args[0].As<v8::String>())->IsOneByteRepresentation();
134 args.GetReturnValue().Set(is_one_byte); 134 args.GetReturnValue().Set(is_one_byte);
135 } 135 }
136 136
137 } // namespace internal 137 } // namespace internal
138 } // namespace v8 138 } // namespace v8
OLDNEW
« no previous file with comments | « src/extensions/externalize-string-extension.h ('k') | src/extensions/free-buffer-extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698