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

Unified Diff: mojo/common/common_type_converters.cc

Issue 2011833003: Implement ui::ClipboardMus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove static in test by creating forwarding clipboard subclass. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/common/common_type_converters.h ('k') | ui/base/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/common_type_converters.cc
diff --git a/mojo/common/common_type_converters.cc b/mojo/common/common_type_converters.cc
index 78418f8e41a1b7c73bcded5b824e8774528736fa..92ae3e2682034aaaaa1e396ec46f9e2ddda3c8bb 100644
--- a/mojo/common/common_type_converters.cc
+++ b/mojo/common/common_type_converters.cc
@@ -56,6 +56,14 @@ Array<uint8_t> TypeConverter<Array<uint8_t>, std::string>::Convert(
return result;
}
+Array<uint8_t> TypeConverter<Array<uint8_t>, base::StringPiece>::Convert(
+ const base::StringPiece& input) {
+ Array<uint8_t> result(input.size());
+ if (!input.empty())
+ memcpy(&result.front(), input.data(), input.size());
+ return result;
+}
+
base::string16 TypeConverter<base::string16, Array<uint8_t>>::Convert(
const Array<uint8_t>& input) {
if (input.is_null() || input.empty())
« no previous file with comments | « mojo/common/common_type_converters.h ('k') | ui/base/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698