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

Side by Side Diff: media/renderers/mock_gpu_video_accelerator_factories.cc

Issue 2253943004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « media/renderers/default_renderer_factory.cc ('k') | media/test/pipeline_integration_test.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "media/renderers/mock_gpu_video_accelerator_factories.h" 5 #include "media/renderers/mock_gpu_video_accelerator_factories.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/gfx/buffer_format_util.h" 8 #include "ui/gfx/buffer_format_util.h"
9 #include "ui/gfx/gpu_memory_buffer.h" 9 #include "ui/gfx/gpu_memory_buffer.h"
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 return true; 89 return true;
90 } 90 }
91 91
92 std::unique_ptr<gfx::GpuMemoryBuffer> 92 std::unique_ptr<gfx::GpuMemoryBuffer>
93 MockGpuVideoAcceleratorFactories::AllocateGpuMemoryBuffer( 93 MockGpuVideoAcceleratorFactories::AllocateGpuMemoryBuffer(
94 const gfx::Size& size, 94 const gfx::Size& size,
95 gfx::BufferFormat format, 95 gfx::BufferFormat format,
96 gfx::BufferUsage /* usage */) { 96 gfx::BufferUsage /* usage */) {
97 if (fail_to_allocate_gpu_memory_buffer_) 97 if (fail_to_allocate_gpu_memory_buffer_)
98 return nullptr; 98 return nullptr;
99 return base::WrapUnique(new GpuMemoryBufferImpl(size, format)); 99 return base::MakeUnique<GpuMemoryBufferImpl>(size, format);
100 } 100 }
101 101
102 std::unique_ptr<base::SharedMemory> 102 std::unique_ptr<base::SharedMemory>
103 MockGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { 103 MockGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) {
104 std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory); 104 std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory);
105 if (shared_memory->CreateAndMapAnonymous(size)) 105 if (shared_memory->CreateAndMapAnonymous(size))
106 return shared_memory; 106 return shared_memory;
107 return nullptr; 107 return nullptr;
108 } 108 }
109 109
(...skipping 28 matching lines...) Expand all
138 } 138 }
139 139
140 private: 140 private:
141 MockGpuVideoAcceleratorFactories* gpu_factories_; 141 MockGpuVideoAcceleratorFactories* gpu_factories_;
142 }; 142 };
143 } // namespace 143 } // namespace
144 144
145 std::unique_ptr<GpuVideoAcceleratorFactories::ScopedGLContextLock> 145 std::unique_ptr<GpuVideoAcceleratorFactories::ScopedGLContextLock>
146 MockGpuVideoAcceleratorFactories::GetGLContextLock() { 146 MockGpuVideoAcceleratorFactories::GetGLContextLock() {
147 DCHECK(gles2_); 147 DCHECK(gles2_);
148 return base::WrapUnique(new ScopedGLContextLockImpl(this)); 148 return base::MakeUnique<ScopedGLContextLockImpl>(this);
149 } 149 }
150 150
151 } // namespace media 151 } // namespace media
OLDNEW
« no previous file with comments | « media/renderers/default_renderer_factory.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698