Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: ppapi/proxy/ppb_buffer_proxy.h

Issue 7629017: Add a unified resource tracker shared between the proxy and the impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Assertion fixed Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_PPB_BUFFER_PROXY_H_ 5 #ifndef PPAPI_PPB_BUFFER_PROXY_H_
6 #define PPAPI_PPB_BUFFER_PROXY_H_ 6 #define PPAPI_PPB_BUFFER_PROXY_H_
7 7
8 #include "base/shared_memory.h" 8 #include "base/shared_memory.h"
9 #include "ppapi/c/pp_instance.h" 9 #include "ppapi/c/pp_instance.h"
10 #include "ppapi/proxy/interface_proxy.h" 10 #include "ppapi/proxy/interface_proxy.h"
11 #include "ppapi/proxy/plugin_resource.h" 11 #include "ppapi/shared_impl/resource.h"
12 #include "ppapi/thunk/ppb_buffer_api.h" 12 #include "ppapi/thunk/ppb_buffer_api.h"
13 13
14 struct PPB_Buffer_Dev; 14 struct PPB_Buffer_Dev;
15 15
16 namespace ppapi { 16 namespace ppapi {
17 class HostResource; 17 class HostResource;
18 } 18 }
19 19
20 namespace pp { 20 namespace pp {
21 namespace proxy { 21 namespace proxy {
22 22
23 class Buffer : public ppapi::thunk::PPB_Buffer_API, 23 class Buffer : public ppapi::thunk::PPB_Buffer_API,
24 public PluginResource { 24 public ppapi::Resource {
25 public: 25 public:
26 Buffer(const ppapi::HostResource& resource, 26 Buffer(const ppapi::HostResource& resource,
27 const base::SharedMemoryHandle& shm_handle, 27 const base::SharedMemoryHandle& shm_handle,
28 uint32_t size); 28 uint32_t size);
29 virtual ~Buffer(); 29 virtual ~Buffer();
30 30
31 // ResourceObjectBase overrides. 31 // Resource overrides.
32 virtual ppapi::thunk::PPB_Buffer_API* AsPPB_Buffer_API() OVERRIDE; 32 virtual ppapi::thunk::PPB_Buffer_API* AsPPB_Buffer_API() OVERRIDE;
33 33
34 // PPB_Buffer_API implementation. 34 // PPB_Buffer_API implementation.
35 virtual PP_Bool Describe(uint32_t* size_in_bytes) OVERRIDE; 35 virtual PP_Bool Describe(uint32_t* size_in_bytes) OVERRIDE;
36 virtual PP_Bool IsMapped() OVERRIDE; 36 virtual PP_Bool IsMapped() OVERRIDE;
37 virtual void* Map() OVERRIDE; 37 virtual void* Map() OVERRIDE;
38 virtual void Unmap() OVERRIDE; 38 virtual void Unmap() OVERRIDE;
39 39
40 private: 40 private:
41 base::SharedMemory shm_; 41 base::SharedMemory shm_;
(...skipping 29 matching lines...) Expand all
71 void OnMsgCreate(PP_Instance instance, 71 void OnMsgCreate(PP_Instance instance,
72 uint32_t size, 72 uint32_t size,
73 ppapi::HostResource* result_resource, 73 ppapi::HostResource* result_resource,
74 base::SharedMemoryHandle* result_shm_handle); 74 base::SharedMemoryHandle* result_shm_handle);
75 }; 75 };
76 76
77 } // namespace proxy 77 } // namespace proxy
78 } // namespace pp 78 } // namespace pp
79 79
80 #endif // PPAPI_PPB_BUFFER_PROXY_H_ 80 #endif // PPAPI_PPB_BUFFER_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698