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

Unified Diff: mojo/public/cpp/bindings/string_traits_string_piece.h

Issue 1968623002: Mojo C++ bindings: expose public <struct>DataView and StringDataView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@25_totally_new
Patch Set: Created 4 years, 7 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/public/cpp/bindings/string_traits_standard.h ('k') | mojo/public/cpp/bindings/string_traits_wtf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/string_traits_string_piece.h
diff --git a/mojo/public/cpp/bindings/string_traits_string_piece.h b/mojo/public/cpp/bindings/string_traits_string_piece.h
index cc126edbc1f07d26fb5a1850a322c9187248888c..b6018f22fbe8a99d8da775620025aebf84bfb347 100644
--- a/mojo/public/cpp/bindings/string_traits_string_piece.h
+++ b/mojo/public/cpp/bindings/string_traits_string_piece.h
@@ -25,11 +25,9 @@ struct StringTraits<base::StringPiece> {
return input.data();
}
- // TODO(yzshen): Use a public type, such as mojo::String::DataView, for
- // |input|.
- static bool Read(internal::String_Data* input, base::StringPiece* output) {
- if (input)
- output->set(input->storage(), input->size());
+ static bool Read(StringDataView input, base::StringPiece* output) {
+ if (!input.is_null())
+ output->set(input.storage(), input.size());
else
output->set(nullptr, 0);
return true;
« no previous file with comments | « mojo/public/cpp/bindings/string_traits_standard.h ('k') | mojo/public/cpp/bindings/string_traits_wtf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698