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

Unified Diff: mojo/public/bindings/lib/bindings_internal.h

Issue 220243007: Mojo: Move mojo/public/bindings/lib to mojo/public/cpp/bindings/lib. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/bindings/lib/array_internal.cc ('k') | mojo/public/bindings/lib/bindings_serialization.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/lib/bindings_internal.h
diff --git a/mojo/public/bindings/lib/bindings_internal.h b/mojo/public/bindings/lib/bindings_internal.h
deleted file mode 100644
index 3a167f30f842abd894aff2ca315b5e8f3dec03eb..0000000000000000000000000000000000000000
--- a/mojo/public/bindings/lib/bindings_internal.h
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright 2013 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_BINDINGS_LIB_BINDINGS_INTERNAL_H_
-#define MOJO_PUBLIC_BINDINGS_LIB_BINDINGS_INTERNAL_H_
-
-#include "mojo/public/cpp/system/core.h"
-
-namespace mojo {
-namespace internal {
-template <typename T> class Array_Data;
-
-#pragma pack(push, 1)
-
-struct StructHeader {
- uint32_t num_bytes;
- uint32_t num_fields;
-};
-MOJO_COMPILE_ASSERT(sizeof(StructHeader) == 8, bad_sizeof_StructHeader);
-
-struct ArrayHeader {
- uint32_t num_bytes;
- uint32_t num_elements;
-};
-MOJO_COMPILE_ASSERT(sizeof(ArrayHeader) == 8, bad_sizeof_ArrayHeader);
-
-template <typename T>
-union StructPointer {
- uint64_t offset;
- T* ptr;
-};
-MOJO_COMPILE_ASSERT(sizeof(StructPointer<char>) == 8, bad_sizeof_StructPointer);
-
-template <typename T>
-union ArrayPointer {
- uint64_t offset;
- Array_Data<T>* ptr;
-};
-MOJO_COMPILE_ASSERT(sizeof(ArrayPointer<char>) == 8, bad_sizeof_ArrayPointer);
-
-union StringPointer {
- uint64_t offset;
- Array_Data<char>* ptr;
-};
-MOJO_COMPILE_ASSERT(sizeof(StringPointer) == 8, bad_sizeof_StringPointer);
-
-#pragma pack(pop)
-
-template <typename T>
-void ResetIfNonNull(T* ptr) {
- if (ptr)
- *ptr = T();
-}
-
-template <typename T>
-T FetchAndReset(T* ptr) {
- T temp = *ptr;
- *ptr = T();
- return temp;
-}
-
-template <typename T>
-class WrapperHelper {
- public:
- static const T Wrap(const typename T::Data* data) {
- return T(typename T::Wrap(), const_cast<typename T::Data*>(data));
- }
- static typename T::Data* Unwrap(const T& object) {
- return const_cast<typename T::Data*>(object.data_);
- }
-};
-
-template <typename Data>
-inline const typename Data::Wrapper Wrap(const Data* data) {
- return WrapperHelper<typename Data::Wrapper>::Wrap(data);
-}
-
-template <typename T>
-inline typename T::Data* Unwrap(const T& object) {
- return WrapperHelper<T>::Unwrap(object);
-}
-
-template <typename T> struct TypeTraits {
- static const bool kIsObject = true;
-};
-template <> struct TypeTraits<bool> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<char> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<int8_t> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<int16_t> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<int32_t> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<int64_t> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<uint8_t> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<uint16_t> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<uint32_t> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<uint64_t> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<float> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<double> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<Handle> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<DataPipeConsumerHandle> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<DataPipeProducerHandle> {
- static const bool kIsObject = false;
-};
-template <> struct TypeTraits<MessagePipeHandle> {
- static const bool kIsObject = false;
-};
-
-template <typename T> class ObjectTraits {};
-
-} // namespace internal
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_BINDINGS_LIB_BINDINGS_INTERNAL_H_
« no previous file with comments | « mojo/public/bindings/lib/array_internal.cc ('k') | mojo/public/bindings/lib/bindings_serialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698