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

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

Issue 2165233003: Mojo C++ bindings: provide data view for all object types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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_data_view.h ('k') | mojo/public/cpp/bindings/struct_traits.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.h
diff --git a/mojo/public/cpp/bindings/string_traits.h b/mojo/public/cpp/bindings/string_traits.h
index a6ade6fdf68df0c036af4edc3dd4a9289267b1d9..7d3075a579704dfb46ea68e2ca6158f54edff19f 100644
--- a/mojo/public/cpp/bindings/string_traits.h
+++ b/mojo/public/cpp/bindings/string_traits.h
@@ -5,26 +5,10 @@
#ifndef MOJO_PUBLIC_CPP_BINDINGS_STRING_TRAITS_H_
#define MOJO_PUBLIC_CPP_BINDINGS_STRING_TRAITS_H_
-#include "base/logging.h"
-#include "mojo/public/cpp/bindings/lib/array_internal.h"
+#include "mojo/public/cpp/bindings/string_data_view.h"
namespace mojo {
-// Access to the contents of a serialized string.
-class StringDataView {
- public:
- explicit StringDataView(internal::String_Data* data) : data_(data) {
- DCHECK(data_);
- }
-
- const char* storage() const { return data_->storage(); }
-
- size_t size() const { return data_->size(); }
-
- private:
- internal::String_Data* data_;
-};
-
// This must be specialized for any type |T| to be serialized/deserialized as
// a mojom string.
//
@@ -40,6 +24,7 @@ class StringDataView {
// static size_t GetSize(const CustomString& input);
// static const char* GetData(const CustomString& input);
//
+// // The caller guarantees that |!input.is_null()|.
// static bool Read(StringDataView input, CustomString* output);
// };
//
« no previous file with comments | « mojo/public/cpp/bindings/string_data_view.h ('k') | mojo/public/cpp/bindings/struct_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698