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

Unified Diff: mojo/public/cpp/bindings/lib/array_traits_wtf.h

Issue 1967703004: Mojo C++ bindings: add StringTraits and ArrayTraits for STL types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@27_update_users
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/lib/array_traits_standard.h ('k') | mojo/public/cpp/bindings/lib/serialization.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/array_traits_wtf.h
diff --git a/mojo/public/cpp/bindings/lib/array_traits_wtf.h b/mojo/public/cpp/bindings/lib/array_traits_wtf.h
deleted file mode 100644
index 0ee128bcd3d2e0ec6d10b530129e3dd90765dc13..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/bindings/lib/array_traits_wtf.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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_LIB_ARRAY_TRAITS_WTF_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_TRAITS_WTF_H_
-
-#include "mojo/public/cpp/bindings/array_traits.h"
-#include "mojo/public/cpp/bindings/wtf_array.h"
-
-namespace mojo {
-
-template <typename U>
-struct ArrayTraits<WTFArray<U>> {
- using Element = U;
-
- static bool IsNull(const WTFArray<U>& input) { return input.is_null(); }
- static void SetToNull(WTFArray<U>* output) { *output = nullptr; }
-
- static size_t GetSize(const WTFArray<U>& input) { return input.size(); }
-
- static U* GetData(WTFArray<U>& input) { return &input.front(); }
-
- static const U* GetData(const WTFArray<U>& input) { return &input.front(); }
-
- static U& GetAt(WTFArray<U>& input, size_t index) { return input[index]; }
-
- static const U& GetAt(const WTFArray<U>& input, size_t index) {
- return input[index];
- }
-
- static void Resize(WTFArray<U>& input, size_t size) { input.resize(size); }
-};
-
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_TRAITS_WTF_H_
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_traits_standard.h ('k') | mojo/public/cpp/bindings/lib/serialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698