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

Side by Side Diff: ppapi/cpp/dev/buffer_dev.h

Issue 10909068: Fix resource leaks in CDM implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates per last set of comments. Created 8 years, 3 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
« no previous file with comments | « no previous file | ppapi/cpp/dev/buffer_dev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_CPP_DEV_BUFFER_DEV_H_ 5 #ifndef PPAPI_CPP_DEV_BUFFER_DEV_H_
6 #define PPAPI_CPP_DEV_BUFFER_DEV_H_ 6 #define PPAPI_CPP_DEV_BUFFER_DEV_H_
7 7
8 #include "ppapi/cpp/resource.h" 8 #include "ppapi/cpp/resource.h"
9 9
10 namespace pp { 10 namespace pp {
11 11
12 class InstanceHandle; 12 class InstanceHandle;
13 13
14 class Buffer_Dev : public Resource { 14 class Buffer_Dev : public Resource {
15 public: 15 public:
16 // Creates an is_null() Buffer object. 16 // Creates an is_null() Buffer object.
17 Buffer_Dev(); 17 Buffer_Dev();
18 Buffer_Dev(const Buffer_Dev& other); 18 Buffer_Dev(const Buffer_Dev& other);
19 explicit Buffer_Dev(PP_Resource resource); 19 explicit Buffer_Dev(PP_Resource resource);
20 20
21 // Creates & Maps a new Buffer in the browser with the given size. The 21 // Creates & Maps a new Buffer in the browser with the given size. The
22 // resulting object will be is_null() if either Create() or Map() fails. 22 // resulting object will be is_null() if either Create() or Map() fails.
23 Buffer_Dev(const InstanceHandle& instance, uint32_t size); 23 Buffer_Dev(const InstanceHandle& instance, uint32_t size);
24 24
25 // Constructor used when the buffer resource already has a reference count
26 // assigned. No additional reference is taken.
27 Buffer_Dev(PassRef, PP_Resource resource);
28
25 // Unmap the underlying shared memory. 29 // Unmap the underlying shared memory.
26 virtual ~Buffer_Dev(); 30 virtual ~Buffer_Dev();
27 31
28 Buffer_Dev& operator=(const Buffer_Dev& rhs); 32 Buffer_Dev& operator=(const Buffer_Dev& rhs);
29 33
30 uint32_t size() const { return size_; } 34 uint32_t size() const { return size_; }
31 void* data() const { return data_; } 35 void* data() const { return data_; }
32 36
33 private: 37 private:
34 void Init(); 38 void Init();
35 39
36 void* data_; 40 void* data_;
37 uint32_t size_; 41 uint32_t size_;
38 }; 42 };
39 43
40 } // namespace pp 44 } // namespace pp
41 45
42 #endif // PPAPI_CPP_DEV_BUFFER_DEV_H_ 46 #endif // PPAPI_CPP_DEV_BUFFER_DEV_H_
OLDNEW
« no previous file with comments | « no previous file | ppapi/cpp/dev/buffer_dev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698