| 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 CHROMECAST_COMMON_MEDIA_SHARED_MEMORY_CHUNK_H_ | 5 #ifndef CHROMECAST_COMMON_MEDIA_SHARED_MEMORY_CHUNK_H_ |
| 6 #define CHROMECAST_COMMON_MEDIA_SHARED_MEMORY_CHUNK_H_ | 6 #define CHROMECAST_COMMON_MEDIA_SHARED_MEMORY_CHUNK_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "chromecast/media/cma/ipc/media_memory_chunk.h" | 13 #include "chromecast/media/cma/ipc/media_memory_chunk.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 class SharedMemory; | 16 class SharedMemory; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace chromecast { | 19 namespace chromecast { |
| 19 namespace media { | 20 namespace media { |
| 20 | 21 |
| 21 class SharedMemoryChunk : public MediaMemoryChunk { | 22 class SharedMemoryChunk : public MediaMemoryChunk { |
| 22 public: | 23 public: |
| 23 SharedMemoryChunk(scoped_ptr<base::SharedMemory> shared_mem, | 24 SharedMemoryChunk(std::unique_ptr<base::SharedMemory> shared_mem, |
| 24 size_t size); | 25 size_t size); |
| 25 ~SharedMemoryChunk() override; | 26 ~SharedMemoryChunk() override; |
| 26 | 27 |
| 27 // MediaMemoryChunk implementation. | 28 // MediaMemoryChunk implementation. |
| 28 void* data() const override; | 29 void* data() const override; |
| 29 size_t size() const override; | 30 size_t size() const override; |
| 30 bool valid() const override; | 31 bool valid() const override; |
| 31 | 32 |
| 32 private: | 33 private: |
| 33 scoped_ptr<base::SharedMemory> shared_mem_; | 34 std::unique_ptr<base::SharedMemory> shared_mem_; |
| 34 size_t size_; | 35 size_t size_; |
| 35 | 36 |
| 36 DISALLOW_COPY_AND_ASSIGN(SharedMemoryChunk); | 37 DISALLOW_COPY_AND_ASSIGN(SharedMemoryChunk); |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 } // namespace media | 40 } // namespace media |
| 40 } // namespace chromecast | 41 } // namespace chromecast |
| 41 | 42 |
| 42 #endif // CHROMECAST_COMMON_MEDIA_SHARED_MEMORY_CHUNK_H_ | 43 #endif // CHROMECAST_COMMON_MEDIA_SHARED_MEMORY_CHUNK_H_ |
| OLD | NEW |