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

Unified Diff: gin/converter.cc

Issue 93813002: Implement gin::ObjectTemplateBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asdf Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gin/converter.h ('k') | gin/function_template.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/converter.cc
diff --git a/gin/converter.cc b/gin/converter.cc
index c7a572af47db4fc99bcf6d84f4000dd870668339..54736f95aaf48a20713f59d9be77cfe23ce296a6 100644
--- a/gin/converter.cc
+++ b/gin/converter.cc
@@ -91,12 +91,15 @@ bool Converter<double>::FromV8(Isolate* isolate, Handle<Value> val,
return true;
}
+Handle<Value> Converter<base::StringPiece>::ToV8(
+ Isolate* isolate, const base::StringPiece& val) {
+ return String::NewFromUtf8(isolate, val.data(), String::kNormalString,
+ static_cast<uint32_t>(val.length()));
+}
+
Handle<Value> Converter<std::string>::ToV8(Isolate* isolate,
const std::string& val) {
- return String::NewFromUtf8(isolate,
- val.data(),
- String::kNormalString,
- static_cast<uint32_t>(val.length()));
+ return Converter<base::StringPiece>::ToV8(isolate, val);
}
bool Converter<std::string>::FromV8(Isolate* isolate, Handle<Value> val,
@@ -171,7 +174,7 @@ bool Converter<Handle<Value> >::FromV8(Isolate* isolate, Handle<Value> val,
}
v8::Handle<v8::String> StringToSymbol(v8::Isolate* isolate,
- const std::string& val) {
+ const base::StringPiece& val) {
return String::NewFromUtf8(isolate,
val.data(),
String::kInternalizedString,
« no previous file with comments | « gin/converter.h ('k') | gin/function_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698