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

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

Issue 1913043002: Convert ManifestManager IPCs to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: mojo/public/cpp/bindings/string_traits_nullable_string16.h
diff --git a/mojo/public/cpp/bindings/string_traits_nullable_string16.h b/mojo/public/cpp/bindings/string_traits_nullable_string16.h
new file mode 100644
index 0000000000000000000000000000000000000000..ff2621a9a508903c339366da412984546088b7c3
--- /dev/null
+++ b/mojo/public/cpp/bindings/string_traits_nullable_string16.h
@@ -0,0 +1,35 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_STRING_TRAITS_NULLABLE_STRING16_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_STRING_TRAITS_NULLABLE_STRING16_H_
+
+#include "base/strings/nullable_string16.h"
+#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
+#include "mojo/public/cpp/bindings/string_traits.h"
+
+namespace mojo {
+
+template <>
+struct StringTraits<base::NullableString16> {
+ static bool IsNull(const base::NullableString16& input) {
+ return input.is_null();
+ }
+ static void SetToNull(base::NullableString16* output);
+
+ static void* SetUpContext(const base::NullableString16& input);
+ static void TearDownContext(const base::NullableString16& input,
+ void* context);
+
+ static size_t GetSize(const base::NullableString16& input, void* context);
+
+ static const char* GetData(const base::NullableString16& input,
+ void* context);
+
+ static bool Read(StringDataView input, base::NullableString16* output);
+};
+
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_STRING_TRAITS_NULLABLE_STRING16_H_

Powered by Google App Engine
This is Rietveld 408576698