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

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

Issue 2607063002: Remove mojo::Array. (Closed)
Patch Set: rebase Created 3 years, 11 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/array_traits_standard.h
diff --git a/mojo/public/cpp/bindings/array_traits_standard.h b/mojo/public/cpp/bindings/array_traits_standard.h
deleted file mode 100644
index 862de6b6d0daae9837eb4a63c8659d311206d63c..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/bindings/array_traits_standard.h
+++ /dev/null
@@ -1,43 +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_ARRAY_TRAITS_STANDARD_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_TRAITS_STANDARD_H_
-
-#include "mojo/public/cpp/bindings/array.h"
-#include "mojo/public/cpp/bindings/array_traits.h"
-
-namespace mojo {
-
-template <typename T>
-struct ArrayTraits<Array<T>> {
- using Element = T;
-
- static bool IsNull(const Array<T>& input) { return input.is_null(); }
- static void SetToNull(Array<T>* output) { *output = nullptr; }
-
- static size_t GetSize(const Array<T>& input) { return input.size(); }
-
- static T* GetData(Array<T>& input) { return &input.front(); }
-
- static const T* GetData(const Array<T>& input) { return &input.front(); }
-
- static typename Array<T>::RefType GetAt(Array<T>& input, size_t index) {
- return input[index];
- }
-
- static typename Array<T>::ConstRefType GetAt(const Array<T>& input,
- size_t index) {
- return input[index];
- }
-
- static bool Resize(Array<T>& input, size_t size) {
- input.resize(size);
- return true;
- }
-};
-
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_TRAITS_STANDARD_H_

Powered by Google App Engine
This is Rietveld 408576698