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, |