Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_ |
| 6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "media/cdm/cdm_allocator.h" | 17 #include "media/cdm/cdm_allocator.h" |
| 18 #include "media/mojo/services/media_mojo_export.h" | |
| 18 #include "mojo/public/cpp/system/buffer.h" | 19 #include "mojo/public/cpp/system/buffer.h" |
| 19 | 20 |
| 20 namespace media { | 21 namespace media { |
| 21 | 22 |
| 22 // This is a CdmAllocator that creates buffers using mojo shared memory. | 23 // This is a CdmAllocator that creates buffers using mojo shared memory. |
| 23 // The internal logic is similar to ppapi_cdm_buffer.cc. | 24 // The internal logic is similar to ppapi_cdm_buffer.cc. |
| 24 class MojoCdmAllocator : public CdmAllocator { | 25 class MEDIA_MOJO_EXPORT MojoCdmAllocator : public CdmAllocator { |
|
ddorwin
2016/05/11 23:02:28
Why wasn't this necessary before? Do we really wan
xhwang
2016/05/16 05:41:21
Previously we use a source_set, where this file wi
| |
| 25 public: | 26 public: |
| 26 MojoCdmAllocator(); | 27 MojoCdmAllocator(); |
| 27 ~MojoCdmAllocator() final; | 28 ~MojoCdmAllocator() final; |
| 28 | 29 |
| 29 // CdmAllocator implementation. | 30 // CdmAllocator implementation. |
| 30 cdm::Buffer* CreateCdmBuffer(size_t capacity) final; | 31 cdm::Buffer* CreateCdmBuffer(size_t capacity) final; |
| 31 std::unique_ptr<VideoFrameImpl> CreateCdmVideoFrame() final; | 32 std::unique_ptr<VideoFrameImpl> CreateCdmVideoFrame() final; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 friend class MojoCdmAllocatorTest; | 35 friend class MojoCdmAllocatorTest; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 63 | 64 |
| 64 // NOTE: Weak pointers must be invalidated before all other member variables. | 65 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 65 base::WeakPtrFactory<MojoCdmAllocator> weak_ptr_factory_; | 66 base::WeakPtrFactory<MojoCdmAllocator> weak_ptr_factory_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(MojoCdmAllocator); | 68 DISALLOW_COPY_AND_ASSIGN(MojoCdmAllocator); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace media | 71 } // namespace media |
| 71 | 72 |
| 72 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_ | 73 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_ |
| OLD | NEW |