| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |