Index: mojo/services/html_viewer/blink_basic_type_converters.cc |
diff --git a/mojo/services/html_viewer/blink_basic_type_converters.cc b/mojo/services/html_viewer/blink_basic_type_converters.cc |
index 23b9e5f2ddddcb432b433424467749bb545d5b97..eb526526a848a64e52ccf170af7338af1adbd0ec 100644 |
--- a/mojo/services/html_viewer/blink_basic_type_converters.cc |
+++ b/mojo/services/html_viewer/blink_basic_type_converters.cc |
@@ -21,4 +21,14 @@ WebString TypeConverter<WebString, String>::Convert(const String& str) { |
return WebString::fromUTF8(str.get()); |
} |
+// static |
+Array<uint8_t> TypeConverter<Array<uint8_t>, blink::WebString>::Convert( |
+ const blink::WebString& input) { |
+ std::string utf8 = input.utf8(); |
+ Array<uint8_t> result(utf8.size()); |
+ for (size_t i = 0; i < utf8.size(); ++i) |
+ result[i] = utf8[i]; |
+ return result.Pass(); |
+} |
+ |
} // namespace mojo |