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

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

Issue 2544953002: content: Some code cleanup related to shared memory allocation. (Closed)
Patch Set: . Created 4 years 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/child/child_thread_impl.cc ('k') | content/renderer/render_thread_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 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> 292 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock>
293 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { 293 RendererGpuVideoAcceleratorFactories::GetGLContextLock() {
294 if (CheckContextLost()) 294 if (CheckContextLost())
295 return nullptr; 295 return nullptr;
296 return base::MakeUnique<ScopedGLContextLockImpl>(context_provider_); 296 return base::MakeUnique<ScopedGLContextLockImpl>(context_provider_);
297 } 297 }
298 298
299 std::unique_ptr<base::SharedMemory> 299 std::unique_ptr<base::SharedMemory>
300 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { 300 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) {
301 std::unique_ptr<base::SharedMemory> mem(ChildThreadImpl::AllocateSharedMemory( 301 std::unique_ptr<base::SharedMemory> mem(
302 size, thread_safe_sender_.get(), nullptr)); 302 ChildThreadImpl::AllocateSharedMemory(size));
303 if (mem && !mem->Map(size)) 303 if (mem && !mem->Map(size))
304 return nullptr; 304 return nullptr;
305 return mem; 305 return mem;
306 } 306 }
307 307
308 scoped_refptr<base::SingleThreadTaskRunner> 308 scoped_refptr<base::SingleThreadTaskRunner>
309 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { 309 RendererGpuVideoAcceleratorFactories::GetTaskRunner() {
310 return task_runner_; 310 return task_runner_;
311 } 311 }
312 312
(...skipping 18 matching lines...) Expand all
331 context_provider_refptr_ = nullptr; 331 context_provider_refptr_ = nullptr;
332 } 332 }
333 333
334 scoped_refptr<ContextProviderCommandBuffer> 334 scoped_refptr<ContextProviderCommandBuffer>
335 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { 335 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() {
336 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 336 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
337 return context_provider_refptr_; 337 return context_provider_refptr_;
338 } 338 }
339 339
340 } // namespace content 340 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_thread_impl.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698