| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/edk/system/shared_buffer_dispatcher.h" | 5 #include "mojo/edk/system/shared_buffer_dispatcher.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 *result = MOJO_RESULT_OK; | 95 *result = MOJO_RESULT_OK; |
| 96 return CreateInternal(std::move(shared_buffer)); | 96 return CreateInternal(std::move(shared_buffer)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 Dispatcher::Type SharedBufferDispatcher::GetType() const { | 99 Dispatcher::Type SharedBufferDispatcher::GetType() const { |
| 100 return Type::SHARED_BUFFER; | 100 return Type::SHARED_BUFFER; |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool SharedBufferDispatcher::SupportsEntrypointClass( | 103 bool SharedBufferDispatcher::SupportsEntrypointClass( |
| 104 EntrypointClass entrypoint_class) const { | 104 EntrypointClass entrypoint_class) const { |
| 105 return (entrypoint_class == EntrypointClass::BUFFER); | 105 return (entrypoint_class == EntrypointClass::NONE || |
| 106 entrypoint_class == EntrypointClass::BUFFER); |
| 106 } | 107 } |
| 107 | 108 |
| 108 // static | 109 // static |
| 109 RefPtr<SharedBufferDispatcher> SharedBufferDispatcher::Deserialize( | 110 RefPtr<SharedBufferDispatcher> SharedBufferDispatcher::Deserialize( |
| 110 Channel* channel, | 111 Channel* channel, |
| 111 const void* source, | 112 const void* source, |
| 112 size_t size, | 113 size_t size, |
| 113 std::vector<ScopedPlatformHandle>* platform_handles) { | 114 std::vector<ScopedPlatformHandle>* platform_handles) { |
| 114 DCHECK(channel); | 115 DCHECK(channel); |
| 115 | 116 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 platform_handles->push_back(std::move(platform_handle)); | 330 platform_handles->push_back(std::move(platform_handle)); |
| 330 *actual_size = sizeof(SerializedSharedBufferDispatcher); | 331 *actual_size = sizeof(SerializedSharedBufferDispatcher); |
| 331 | 332 |
| 332 shared_buffer_ = nullptr; | 333 shared_buffer_ = nullptr; |
| 333 | 334 |
| 334 return true; | 335 return true; |
| 335 } | 336 } |
| 336 | 337 |
| 337 } // namespace system | 338 } // namespace system |
| 338 } // namespace mojo | 339 } // namespace mojo |
| OLD | NEW |