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

Unified Diff: gin/converter.cc

Issue 93813002: Implement gin::ObjectTemplateBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: gin/converter.cc
diff --git a/gin/converter.cc b/gin/converter.cc
index 04fe7eaf9e93dc2fa31a4e3c598530a8752e3de3..42ae13f037aa997e670898a2518875e89422a112 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') | gin/function_template.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698