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

Side by Side Diff: mojo/edk/system/shared_buffer_dispatcher.cc

Issue 1915153002: EDK: Add Dispatcher::SupportsEntrypointClass(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
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 unified diff | Download patch
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 *result = MOJO_RESULT_OK; 92 *result = MOJO_RESULT_OK;
93 return CreateInternal(std::move(shared_buffer)); 93 return CreateInternal(std::move(shared_buffer));
94 } 94 }
95 95
96 Dispatcher::Type SharedBufferDispatcher::GetType() const { 96 Dispatcher::Type SharedBufferDispatcher::GetType() const {
97 return Type::SHARED_BUFFER; 97 return Type::SHARED_BUFFER;
98 } 98 }
99 99
100 bool SharedBufferDispatcher::SupportsEntrypointClass(
101 EntrypointClass entrypoint_class) const {
102 return (entrypoint_class == EntrypointClass::BUFFER);
103 }
104
100 // static 105 // static
101 RefPtr<SharedBufferDispatcher> SharedBufferDispatcher::Deserialize( 106 RefPtr<SharedBufferDispatcher> SharedBufferDispatcher::Deserialize(
102 Channel* channel, 107 Channel* channel,
103 const void* source, 108 const void* source,
104 size_t size, 109 size_t size,
105 std::vector<ScopedPlatformHandle>* platform_handles) { 110 std::vector<ScopedPlatformHandle>* platform_handles) {
106 DCHECK(channel); 111 DCHECK(channel);
107 112
108 if (size != sizeof(SerializedSharedBufferDispatcher)) { 113 if (size != sizeof(SerializedSharedBufferDispatcher)) {
109 LOG(ERROR) << "Invalid serialized shared buffer dispatcher (bad size)"; 114 LOG(ERROR) << "Invalid serialized shared buffer dispatcher (bad size)";
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 platform_handles->push_back(std::move(platform_handle)); 321 platform_handles->push_back(std::move(platform_handle));
317 *actual_size = sizeof(SerializedSharedBufferDispatcher); 322 *actual_size = sizeof(SerializedSharedBufferDispatcher);
318 323
319 shared_buffer_ = nullptr; 324 shared_buffer_ = nullptr;
320 325
321 return true; 326 return true;
322 } 327 }
323 328
324 } // namespace system 329 } // namespace system
325 } // namespace mojo 330 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher.h ('k') | mojo/edk/system/shared_buffer_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698