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

Unified Diff: mojo/public/cpp/bindings/lib/serialization_util.cc

Issue 1955123003: Mojo C++ bindings: switch the remaining callsites of the old serialization interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@24_union_and_others
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
Index: mojo/public/cpp/bindings/lib/serialization_util.cc
diff --git a/mojo/public/cpp/bindings/lib/serialization_util.cc b/mojo/public/cpp/bindings/lib/serialization_util.cc
index 4624ff8baa1dc75fbdca51a897c4c64f44ba1662..d672243b7794c907a78757166b6a6b0c8a08ff64 100644
--- a/mojo/public/cpp/bindings/lib/serialization_util.cc
+++ b/mojo/public/cpp/bindings/lib/serialization_util.cc
@@ -4,13 +4,6 @@
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
-#include <stddef.h>
-#include <stdint.h>
-
-#include <limits>
-
-#include "base/logging.h"
-
namespace mojo {
namespace internal {
@@ -56,50 +49,5 @@ const void* DecodePointerRaw(const uint64_t* offset) {
return reinterpret_cast<const char*>(offset) + *offset;
}
-SerializedHandleVector::SerializedHandleVector() {}
-
-SerializedHandleVector::~SerializedHandleVector() {
- for (auto handle : handles_) {
- if (handle.is_valid()) {
- MojoResult rv = MojoClose(handle.value());
- DCHECK_EQ(rv, MOJO_RESULT_OK);
- }
- }
-}
-
-Handle_Data SerializedHandleVector::AddHandle(mojo::Handle handle) {
- Handle_Data data;
- if (!handle.is_valid()) {
- data.value = kEncodedInvalidHandleValue;
- } else {
- DCHECK_LT(handles_.size(), std::numeric_limits<uint32_t>::max());
- data.value = static_cast<uint32_t>(handles_.size());
- handles_.push_back(handle);
- }
- return data;
-}
-
-mojo::Handle SerializedHandleVector::TakeHandle(
- const Handle_Data& encoded_handle) {
- if (!encoded_handle.is_valid())
- return mojo::Handle();
- DCHECK_LT(encoded_handle.value, handles_.size());
- return FetchAndReset(&handles_[encoded_handle.value]);
-}
-
-void SerializedHandleVector::Swap(std::vector<mojo::Handle>* other) {
- handles_.swap(*other);
-}
-
-SerializationContext::SerializationContext() {}
-
-SerializationContext::SerializationContext(
- scoped_refptr<MultiplexRouter> in_router)
- : router(std::move(in_router)) {}
-
-SerializationContext::~SerializationContext() {
- DCHECK(!custom_contexts || custom_contexts->empty());
-}
-
} // namespace internal
} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/lib/serialization_util.h ('k') | mojo/public/cpp/bindings/lib/string_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698