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

Side by Side Diff: content/renderer/pepper/ppb_buffer_impl.h

Issue 1873783003: Convert //content/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « content/renderer/pepper/plugin_object.cc ('k') | content/renderer/pepper/ppb_buffer_impl.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 CONTENT_RENDERER_PEPPER_PPB_BUFFER_IMPL_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PPB_BUFFER_IMPL_H_
6 #define CONTENT_RENDERER_PEPPER_PPB_BUFFER_IMPL_H_ 6 #define CONTENT_RENDERER_PEPPER_PPB_BUFFER_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
11
10 #include "base/macros.h" 12 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/shared_memory.h" 14 #include "base/memory/shared_memory.h"
14 #include "ppapi/shared_impl/resource.h" 15 #include "ppapi/shared_impl/resource.h"
15 #include "ppapi/thunk/ppb_buffer_api.h" 16 #include "ppapi/thunk/ppb_buffer_api.h"
16 17
17 namespace content { 18 namespace content {
18 19
19 class PPB_Buffer_Impl : public ppapi::Resource, 20 class PPB_Buffer_Impl : public ppapi::Resource,
20 public ppapi::thunk::PPB_Buffer_API { 21 public ppapi::thunk::PPB_Buffer_API {
21 public: 22 public:
22 static PP_Resource Create(PP_Instance instance, uint32_t size); 23 static PP_Resource Create(PP_Instance instance, uint32_t size);
(...skipping 16 matching lines...) Expand all
39 40
40 // Trusted. 41 // Trusted.
41 int32_t GetSharedMemory(base::SharedMemory** shm) override; 42 int32_t GetSharedMemory(base::SharedMemory** shm) override;
42 43
43 private: 44 private:
44 ~PPB_Buffer_Impl() override; 45 ~PPB_Buffer_Impl() override;
45 46
46 explicit PPB_Buffer_Impl(PP_Instance instance); 47 explicit PPB_Buffer_Impl(PP_Instance instance);
47 bool Init(uint32_t size); 48 bool Init(uint32_t size);
48 49
49 scoped_ptr<base::SharedMemory> shared_memory_; 50 std::unique_ptr<base::SharedMemory> shared_memory_;
50 uint32_t size_; 51 uint32_t size_;
51 int map_count_; 52 int map_count_;
52 53
53 DISALLOW_COPY_AND_ASSIGN(PPB_Buffer_Impl); 54 DISALLOW_COPY_AND_ASSIGN(PPB_Buffer_Impl);
54 }; 55 };
55 56
56 // Ensures that the given buffer is mapped, and returns it to its previous 57 // Ensures that the given buffer is mapped, and returns it to its previous
57 // mapped state in the destructor. 58 // mapped state in the destructor.
58 class BufferAutoMapper { 59 class BufferAutoMapper {
59 public: 60 public:
(...skipping 11 matching lines...) Expand all
71 72
72 void* data_; 73 void* data_;
73 uint32_t size_; 74 uint32_t size_;
74 75
75 DISALLOW_COPY_AND_ASSIGN(BufferAutoMapper); 76 DISALLOW_COPY_AND_ASSIGN(BufferAutoMapper);
76 }; 77 };
77 78
78 } // namespace content 79 } // namespace content
79 80
80 #endif // CONTENT_RENDERER_PEPPER_PPB_BUFFER_IMPL_H_ 81 #endif // CONTENT_RENDERER_PEPPER_PPB_BUFFER_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/pepper/plugin_object.cc ('k') | content/renderer/pepper/ppb_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698