OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ |
6 #define PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ | 6 #define PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <queue> | 11 #include <queue> |
11 | 12 |
12 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
17 #include "ppapi/proxy/connection.h" | 17 #include "ppapi/proxy/connection.h" |
18 #include "ppapi/proxy/plugin_resource.h" | 18 #include "ppapi/proxy/plugin_resource.h" |
19 #include "ppapi/proxy/ppapi_proxy_export.h" | 19 #include "ppapi/proxy/ppapi_proxy_export.h" |
20 #include "ppapi/shared_impl/resource.h" | 20 #include "ppapi/shared_impl/resource.h" |
21 #include "ppapi/shared_impl/scoped_pp_resource.h" | 21 #include "ppapi/shared_impl/scoped_pp_resource.h" |
22 #include "ppapi/thunk/ppb_video_decoder_api.h" | 22 #include "ppapi/thunk/ppb_video_decoder_api.h" |
23 | 23 |
24 namespace gpu { | 24 namespace gpu { |
25 struct Mailbox; | 25 struct Mailbox; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void OnReplyReceived(const ResourceMessageReplyParams& params, | 78 void OnReplyReceived(const ResourceMessageReplyParams& params, |
79 const IPC::Message& msg) override; | 79 const IPC::Message& msg) override; |
80 | 80 |
81 // Called only by unit tests. This bypasses Graphics3D setup, which doesn't | 81 // Called only by unit tests. This bypasses Graphics3D setup, which doesn't |
82 // work in ppapi::proxy::PluginProxyTest. | 82 // work in ppapi::proxy::PluginProxyTest. |
83 void SetForTest(); | 83 void SetForTest(); |
84 | 84 |
85 private: | 85 private: |
86 // Struct to hold a shared memory buffer. | 86 // Struct to hold a shared memory buffer. |
87 struct ShmBuffer { | 87 struct ShmBuffer { |
88 ShmBuffer(scoped_ptr<base::SharedMemory> shm, | 88 ShmBuffer(std::unique_ptr<base::SharedMemory> shm, |
89 uint32_t size, | 89 uint32_t size, |
90 uint32_t shm_id); | 90 uint32_t shm_id); |
91 ~ShmBuffer(); | 91 ~ShmBuffer(); |
92 | 92 |
93 const scoped_ptr<base::SharedMemory> shm; | 93 const std::unique_ptr<base::SharedMemory> shm; |
94 void* addr; | 94 void* addr; |
95 // Index into shm_buffers_ vector, used as an id. This should map 1:1 to | 95 // Index into shm_buffers_ vector, used as an id. This should map 1:1 to |
96 // the index on the host side of the proxy. | 96 // the index on the host side of the proxy. |
97 const uint32_t shm_id; | 97 const uint32_t shm_id; |
98 }; | 98 }; |
99 | 99 |
100 // Struct to hold texture information. | 100 // Struct to hold texture information. |
101 struct Texture { | 101 struct Texture { |
102 Texture(uint32_t texture_target, const PP_Size& size); | 102 Texture(uint32_t texture_target, const PP_Size& size); |
103 ~Texture(); | 103 ~Texture(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 bool testing_; | 190 bool testing_; |
191 int32_t decoder_last_error_; | 191 int32_t decoder_last_error_; |
192 | 192 |
193 DISALLOW_COPY_AND_ASSIGN(VideoDecoderResource); | 193 DISALLOW_COPY_AND_ASSIGN(VideoDecoderResource); |
194 }; | 194 }; |
195 | 195 |
196 } // namespace proxy | 196 } // namespace proxy |
197 } // namespace ppapi | 197 } // namespace ppapi |
198 | 198 |
199 #endif // PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ | 199 #endif // PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ |
OLD | NEW |