Index: mojo/edk/system/shared_buffer_dispatcher.h |
diff --git a/third_party/mojo/src/mojo/edk/system/shared_buffer_dispatcher.h b/mojo/edk/system/shared_buffer_dispatcher.h |
similarity index 69% |
copy from third_party/mojo/src/mojo/edk/system/shared_buffer_dispatcher.h |
copy to mojo/edk/system/shared_buffer_dispatcher.h |
index 3e6d4f254035d5ffcc4b943b5c815d90efa20a46..f3fc9e80cb14e4dccbfa9f8c27fe6fd271bff420 100644 |
--- a/third_party/mojo/src/mojo/edk/system/shared_buffer_dispatcher.h |
+++ b/mojo/edk/system/shared_buffer_dispatcher.h |
@@ -2,22 +2,18 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
-#define THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
+#ifndef MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
+#define MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
+#include "mojo/edk/embedder/platform_shared_buffer.h" |
+#include "mojo/edk/system/simple_dispatcher.h" |
+#include "mojo/edk/system/system_impl_export.h" |
#include "mojo/public/cpp/system/macros.h" |
-#include "third_party/mojo/src/mojo/edk/embedder/platform_shared_buffer.h" |
-#include "third_party/mojo/src/mojo/edk/system/memory.h" |
-#include "third_party/mojo/src/mojo/edk/system/simple_dispatcher.h" |
-#include "third_party/mojo/src/mojo/edk/system/system_impl_export.h" |
namespace mojo { |
-namespace embedder { |
+namespace edk { |
class PlatformSupport; |
-} |
- |
-namespace system { |
// TODO(vtl): We derive from SimpleDispatcher, even though we don't currently |
// have anything that's waitable. I want to add a "transferrable" wait flag |
@@ -36,7 +32,7 @@ class MOJO_SYSTEM_IMPL_EXPORT SharedBufferDispatcher final |
// |MojoCreateSharedBufferOptions| and will be entirely overwritten on success |
// (it may be partly overwritten on failure). |
static MojoResult ValidateCreateOptions( |
- UserPointer<const MojoCreateSharedBufferOptions> in_options, |
+ const MojoCreateSharedBufferOptions* in_options, |
MojoCreateSharedBufferOptions* out_options); |
// Static factory method: |validated_options| must be validated (obviously). |
@@ -44,7 +40,7 @@ class MOJO_SYSTEM_IMPL_EXPORT SharedBufferDispatcher final |
// TODO(vtl): This should probably be made to return a scoped_refptr and have |
// a MojoResult out parameter instead. |
static MojoResult Create( |
- embedder::PlatformSupport* platform_support, |
+ PlatformSupport* platform_support, |
const MojoCreateSharedBufferOptions& validated_options, |
uint64_t num_bytes, |
scoped_refptr<SharedBufferDispatcher>* result); |
@@ -55,19 +51,18 @@ class MOJO_SYSTEM_IMPL_EXPORT SharedBufferDispatcher final |
// The "opposite" of |SerializeAndClose()|. (Typically this is called by |
// |Dispatcher::Deserialize()|.) |
static scoped_refptr<SharedBufferDispatcher> Deserialize( |
- Channel* channel, |
const void* source, |
size_t size, |
- embedder::PlatformHandleVector* platform_handles); |
+ PlatformHandleVector* platform_handles); |
private: |
static scoped_refptr<SharedBufferDispatcher> CreateInternal( |
- scoped_refptr<embedder::PlatformSharedBuffer> shared_buffer) { |
+ scoped_refptr<PlatformSharedBuffer> shared_buffer) { |
return make_scoped_refptr(new SharedBufferDispatcher(shared_buffer.Pass())); |
} |
explicit SharedBufferDispatcher( |
- scoped_refptr<embedder::PlatformSharedBuffer> shared_buffer); |
+ scoped_refptr<PlatformSharedBuffer> shared_buffer); |
~SharedBufferDispatcher() override; |
// Validates and/or sets default options for |
@@ -76,7 +71,7 @@ class MOJO_SYSTEM_IMPL_EXPORT SharedBufferDispatcher final |
// point to a (current) |MojoDuplicateBufferHandleOptions| and will be |
// entirely overwritten on success (it may be partly overwritten on failure). |
static MojoResult ValidateDuplicateOptions( |
- UserPointer<const MojoDuplicateBufferHandleOptions> in_options, |
+ const MojoDuplicateBufferHandleOptions* in_options, |
MojoDuplicateBufferHandleOptions* out_options); |
// |Dispatcher| protected methods: |
@@ -84,31 +79,26 @@ class MOJO_SYSTEM_IMPL_EXPORT SharedBufferDispatcher final |
scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() |
override; |
MojoResult DuplicateBufferHandleImplNoLock( |
- UserPointer<const MojoDuplicateBufferHandleOptions> options, |
+ const MojoDuplicateBufferHandleOptions* options, |
scoped_refptr<Dispatcher>* new_dispatcher) override; |
MojoResult MapBufferImplNoLock( |
uint64_t offset, |
uint64_t num_bytes, |
MojoMapBufferFlags flags, |
- scoped_ptr<embedder::PlatformSharedBufferMapping>* mapping) override; |
- void StartSerializeImplNoLock(Channel* channel, |
- size_t* max_size, |
- size_t* max_platform_handles) override |
- MOJO_NOT_THREAD_SAFE; |
+ scoped_ptr<PlatformSharedBufferMapping>* mapping) override; |
+ void StartSerializeImplNoLock(size_t* max_size, |
+ size_t* max_platform_handles) override; |
bool EndSerializeAndCloseImplNoLock( |
- Channel* channel, |
void* destination, |
size_t* actual_size, |
- embedder::PlatformHandleVector* platform_handles) override |
- MOJO_NOT_THREAD_SAFE; |
+ PlatformHandleVector* platform_handles) override; |
- scoped_refptr<embedder::PlatformSharedBuffer> shared_buffer_ |
- MOJO_GUARDED_BY(mutex()); |
+ scoped_refptr<PlatformSharedBuffer> shared_buffer_; |
MOJO_DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcher); |
}; |
-} // namespace system |
+} // namespace edk |
} // namespace mojo |
-#endif // THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
+#endif // MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |