| 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 #ifndef THIRD_PARTY_MOJO_SRC_MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SHARED_BUFFER_H_ | 5 #ifndef MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SHARED_BUFFER_H_ |
| 6 #define THIRD_PARTY_MOJO_SRC_MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SHARED_BUFFER_H_ | 6 #define MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SHARED_BUFFER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "mojo/edk/embedder/platform_shared_buffer.h" |
| 11 #include "mojo/edk/system/system_impl_export.h" |
| 10 #include "mojo/public/cpp/system/macros.h" | 12 #include "mojo/public/cpp/system/macros.h" |
| 11 #include "third_party/mojo/src/mojo/edk/embedder/platform_shared_buffer.h" | |
| 12 #include "third_party/mojo/src/mojo/edk/system/system_impl_export.h" | |
| 13 | 13 |
| 14 namespace mojo { | 14 namespace mojo { |
| 15 namespace embedder { | 15 namespace edk { |
| 16 | 16 |
| 17 // A simple implementation of |PlatformSharedBuffer|. | 17 // A simple implementation of |PlatformSharedBuffer|. |
| 18 class MOJO_SYSTEM_IMPL_EXPORT SimplePlatformSharedBuffer final | 18 class MOJO_SYSTEM_IMPL_EXPORT SimplePlatformSharedBuffer final |
| 19 : public PlatformSharedBuffer { | 19 : public PlatformSharedBuffer { |
| 20 public: | 20 public: |
| 21 // Creates a shared buffer of size |num_bytes| bytes (initially zero-filled). | 21 // Creates a shared buffer of size |num_bytes| bytes (initially zero-filled). |
| 22 // |num_bytes| must be nonzero. Returns null on failure. | 22 // |num_bytes| must be nonzero. Returns null on failure. |
| 23 static SimplePlatformSharedBuffer* Create(size_t num_bytes); | 23 static SimplePlatformSharedBuffer* Create(size_t num_bytes); |
| 24 | 24 |
| 25 static SimplePlatformSharedBuffer* CreateFromPlatformHandle( | 25 static SimplePlatformSharedBuffer* CreateFromPlatformHandle( |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 void* const base_; | 89 void* const base_; |
| 90 const size_t length_; | 90 const size_t length_; |
| 91 | 91 |
| 92 void* const real_base_; | 92 void* const real_base_; |
| 93 const size_t real_length_; | 93 const size_t real_length_; |
| 94 | 94 |
| 95 MOJO_DISALLOW_COPY_AND_ASSIGN(SimplePlatformSharedBufferMapping); | 95 MOJO_DISALLOW_COPY_AND_ASSIGN(SimplePlatformSharedBufferMapping); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace embedder | 98 } // namespace edk |
| 99 } // namespace mojo | 99 } // namespace mojo |
| 100 | 100 |
| 101 #endif // THIRD_PARTY_MOJO_SRC_MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SHARED_BUFFER_
H_ | 101 #endif // MOJO_EDK_EMBEDDER_SIMPLE_PLATFORM_SHARED_BUFFER_H_ |
| OLD | NEW |