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

Side by Side Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.cc

Issue 2253053003: 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
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 "content/renderer/media/renderer_gpu_video_accelerator_factories.h" 5 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 private: 262 private:
263 cc::ContextProvider::ScopedContextLock lock_; 263 cc::ContextProvider::ScopedContextLock lock_;
264 }; 264 };
265 } // namespace 265 } // namespace
266 266
267 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> 267 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock>
268 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { 268 RendererGpuVideoAcceleratorFactories::GetGLContextLock() {
269 if (CheckContextLost()) 269 if (CheckContextLost())
270 return nullptr; 270 return nullptr;
271 return base::WrapUnique(new ScopedGLContextLockImpl(context_provider_)); 271 return base::MakeUnique<ScopedGLContextLockImpl>(context_provider_);
272 } 272 }
273 273
274 std::unique_ptr<base::SharedMemory> 274 std::unique_ptr<base::SharedMemory>
275 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { 275 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) {
276 std::unique_ptr<base::SharedMemory> mem(ChildThreadImpl::AllocateSharedMemory( 276 std::unique_ptr<base::SharedMemory> mem(ChildThreadImpl::AllocateSharedMemory(
277 size, thread_safe_sender_.get(), nullptr)); 277 size, thread_safe_sender_.get(), nullptr));
278 if (mem && !mem->Map(size)) 278 if (mem && !mem->Map(size))
279 return nullptr; 279 return nullptr;
280 return mem; 280 return mem;
281 } 281 }
(...skipping 24 matching lines...) Expand all
306 context_provider_refptr_ = nullptr; 306 context_provider_refptr_ = nullptr;
307 } 307 }
308 308
309 scoped_refptr<ContextProviderCommandBuffer> 309 scoped_refptr<ContextProviderCommandBuffer>
310 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { 310 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() {
311 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 311 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
312 return context_provider_refptr_; 312 return context_provider_refptr_;
313 } 313 }
314 314
315 } // namespace content 315 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/gpu/rtc_video_encoder_unittest.cc ('k') | content/renderer/media/rtc_certificate_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698