summaryrefslogtreecommitdiffstats
path: root/mojo/public/cpp/bindings/lib/bindings_serialization.h
diff options
context:
space:
mode:
authorblundell <blundell@chromium.org>2015-01-19 09:18:33 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-19 17:19:27 +0000
commit70fb54767b472a5edfb859e489beeeec7abdb0e4 (patch)
tree28e534ec774391a9f6571a1770e12a0d63ebf833 /mojo/public/cpp/bindings/lib/bindings_serialization.h
parentba5f0233fa38f949e24f6274ba891fa652eab640 (diff)
downloadchromium_src-70fb54767b472a5edfb859e489beeeec7abdb0e4.zip
chromium_src-70fb54767b472a5edfb859e489beeeec7abdb0e4.tar.gz
chromium_src-70fb54767b472a5edfb859e489beeeec7abdb0e4.tar.bz2
Move //mojo/{public, edk} underneath //third_party
This CL move //mojo/public and //mojo/edk to live in the following locations: - //third_party/mojo/src/mojo/public - //third_party/mojo/src/mojo/edk It moves the related gypfiles from //mojo to //third_party/mojo and updates them as necessary to account for the file moves. It also updates clients of the mojo SDK and EDK targets in both GYP and GN. (Note that for GN, the mojo SDK and EDK build systems are maintained in the Mojo repo and designed to be flexible wrt the location of the SDK/EDK in a client repo, so no changes are needed. This CL does not update include paths to the code being moved to limit the number of moving parts, instead relying on the include_dirs that the SDK and EDK targets supply to their direct dependents to ensure that include paths continue to resolve correctly. NOPRESUBMIT=true Review URL: https://codereview.chromium.org/814543006 Cr-Commit-Position: refs/heads/master@{#312129}
Diffstat (limited to 'mojo/public/cpp/bindings/lib/bindings_serialization.h')
-rw-r--r--mojo/public/cpp/bindings/lib/bindings_serialization.h83
1 files changed, 0 insertions, 83 deletions
diff --git a/mojo/public/cpp/bindings/lib/bindings_serialization.h b/mojo/public/cpp/bindings/lib/bindings_serialization.h
deleted file mode 100644
index 6bebf90..0000000
--- a/mojo/public/cpp/bindings/lib/bindings_serialization.h
+++ /dev/null
@@ -1,83 +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_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_
-
-#include <vector>
-
-#include "mojo/public/cpp/system/core.h"
-
-namespace mojo {
-namespace internal {
-
-class BoundsChecker;
-
-// Please note that this is a different value than |mojo::kInvalidHandleValue|,
-// which is the "decoded" invalid handle.
-const MojoHandle kEncodedInvalidHandleValue = static_cast<MojoHandle>(-1);
-
-size_t Align(size_t size);
-char* AlignPointer(char* ptr);
-
-bool IsAligned(const void* ptr);
-
-// Pointers are encoded as relative offsets. The offsets are relative to the
-// address of where the offset value is stored, such that the pointer may be
-// recovered with the expression:
-//
-// ptr = reinterpret_cast<char*>(offset) + *offset
-//
-// A null pointer is encoded as an offset value of 0.
-//
-void EncodePointer(const void* ptr, uint64_t* offset);
-// Note: This function doesn't validate the encoded pointer value.
-const void* DecodePointerRaw(const uint64_t* offset);
-
-// Note: This function doesn't validate the encoded pointer value.
-template <typename T>
-inline void DecodePointer(const uint64_t* offset, T** ptr) {
- *ptr = reinterpret_cast<T*>(const_cast<void*>(DecodePointerRaw(offset)));
-}
-
-// Checks whether decoding the pointer will overflow and produce a pointer
-// smaller than |offset|.
-bool ValidateEncodedPointer(const uint64_t* offset);
-
-// Handles are encoded as indices into a vector of handles. These functions
-// manipulate the value of |handle|, mapping it to and from an index.
-void EncodeHandle(Handle* handle, std::vector<Handle>* handles);
-// Note: This function doesn't validate the encoded handle value.
-void DecodeHandle(Handle* handle, std::vector<Handle>* handles);
-
-// The following 2 functions are used to encode/decode all objects (structs and
-// arrays) in a consistent manner.
-
-template <typename T>
-inline void Encode(T* obj, std::vector<Handle>* handles) {
- if (obj->ptr)
- obj->ptr->EncodePointersAndHandles(handles);
- EncodePointer(obj->ptr, &obj->offset);
-}
-
-// Note: This function doesn't validate the encoded pointer and handle values.
-template <typename T>
-inline void Decode(T* obj, std::vector<Handle>* handles) {
- DecodePointer(&obj->offset, &obj->ptr);
- if (obj->ptr)
- obj->ptr->DecodePointersAndHandles(handles);
-}
-
-// If returns true, this function also claims the memory range of the size
-// specified in the struct header, starting from |data|.
-// Note: |min_num_bytes| must be no less than sizeof(StructHeader).
-bool ValidateStructHeader(const void* data,
- uint32_t min_num_bytes,
- uint32_t min_num_fields,
- BoundsChecker* bounds_checker);
-
-} // namespace internal
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_