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

Side by Side Diff: mojo/public/cpp/bindings/lib/serialization_context.cc

Issue 2660733002: Mojo C++ bindings: introduce an optional array to store transferred interface IDs in messages. (Closed)
Patch Set: . Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/cpp/bindings/lib/serialization_context.h" 5 #include "mojo/public/cpp/bindings/lib/serialization_context.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/public/cpp/bindings/associated_group_controller.h"
11 #include "mojo/public/cpp/system/core.h" 10 #include "mojo/public/cpp/system/core.h"
12 11
13 namespace mojo { 12 namespace mojo {
14 namespace internal { 13 namespace internal {
15 14
16 SerializedHandleVector::SerializedHandleVector() {} 15 SerializedHandleVector::SerializedHandleVector() {}
17 16
18 SerializedHandleVector::~SerializedHandleVector() { 17 SerializedHandleVector::~SerializedHandleVector() {
19 for (auto handle : handles_) { 18 for (auto handle : handles_) {
20 if (handle.is_valid()) { 19 if (handle.is_valid()) {
(...skipping 22 matching lines...) Expand all
43 DCHECK_LT(encoded_handle.value, handles_.size()); 42 DCHECK_LT(encoded_handle.value, handles_.size());
44 return FetchAndReset(&handles_[encoded_handle.value]); 43 return FetchAndReset(&handles_[encoded_handle.value]);
45 } 44 }
46 45
47 void SerializedHandleVector::Swap(std::vector<mojo::Handle>* other) { 46 void SerializedHandleVector::Swap(std::vector<mojo::Handle>* other) {
48 handles_.swap(*other); 47 handles_.swap(*other);
49 } 48 }
50 49
51 SerializationContext::SerializationContext() {} 50 SerializationContext::SerializationContext() {}
52 51
53 SerializationContext::SerializationContext(
54 scoped_refptr<AssociatedGroupController> in_group_controller)
55 : group_controller(std::move(in_group_controller)) {}
56
57 SerializationContext::~SerializationContext() { 52 SerializationContext::~SerializationContext() {
58 DCHECK(!custom_contexts || custom_contexts->empty()); 53 DCHECK(!custom_contexts || custom_contexts->empty());
59 } 54 }
60 55
61 } // namespace internal 56 } // namespace internal
62 } // namespace mojo 57 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/serialization_context.h ('k') | mojo/public/cpp/bindings/lib/validation_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698