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

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

Issue 2010563004: content: Not all memory creation failures are out of memory errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 257
258 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock> 258 std::unique_ptr<media::GpuVideoAcceleratorFactories::ScopedGLContextLock>
259 RendererGpuVideoAcceleratorFactories::GetGLContextLock() { 259 RendererGpuVideoAcceleratorFactories::GetGLContextLock() {
260 if (CheckContextLost()) 260 if (CheckContextLost())
261 return nullptr; 261 return nullptr;
262 return base::WrapUnique(new ScopedGLContextLockImpl(context_provider_)); 262 return base::WrapUnique(new ScopedGLContextLockImpl(context_provider_));
263 } 263 }
264 264
265 std::unique_ptr<base::SharedMemory> 265 std::unique_ptr<base::SharedMemory>
266 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) { 266 RendererGpuVideoAcceleratorFactories::CreateSharedMemory(size_t size) {
267 std::unique_ptr<base::SharedMemory> mem( 267 std::unique_ptr<base::SharedMemory> mem(ChildThreadImpl::AllocateSharedMemory(
268 ChildThreadImpl::AllocateSharedMemory(size, thread_safe_sender_.get())); 268 size, thread_safe_sender_.get(), nullptr));
269 if (mem && !mem->Map(size)) 269 if (mem && !mem->Map(size))
270 return nullptr; 270 return nullptr;
271 return mem; 271 return mem;
272 } 272 }
273 273
274 scoped_refptr<base::SingleThreadTaskRunner> 274 scoped_refptr<base::SingleThreadTaskRunner>
275 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { 275 RendererGpuVideoAcceleratorFactories::GetTaskRunner() {
276 return task_runner_; 276 return task_runner_;
277 } 277 }
278 278
(...skipping 18 matching lines...) Expand all
297 context_provider_refptr_ = nullptr; 297 context_provider_refptr_ = nullptr;
298 } 298 }
299 299
300 scoped_refptr<ContextProviderCommandBuffer> 300 scoped_refptr<ContextProviderCommandBuffer>
301 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { 301 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() {
302 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 302 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
303 return context_provider_refptr_; 303 return context_provider_refptr_;
304 } 304 }
305 305
306 } // namespace content 306 } // 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