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

Side by Side Diff: content/renderer/pepper/pepper_video_encoder_host.cc

Issue 1095893002: gpu: Fix some context lost marking glitches+leaks and add UMA stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kbr's comment Created 5 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/content_common.gypi ('k') | content/renderer/pepper/ppb_graphics_3d_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/shared_memory.h" 6 #include "base/memory/shared_memory.h"
7 #include "base/numerics/safe_math.h" 7 #include "base/numerics/safe_math.h"
8 #include "content/common/gpu/client/command_buffer_proxy_impl.h" 8 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
9 #include "content/common/gpu/media/gpu_video_accelerator_util.h" 9 #include "content/common/gpu/media/gpu_video_accelerator_util.h"
10 #include "content/common/pepper_file_util.h" 10 #include "content/common/pepper_file_util.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 506
507 std::vector<int32> attribs(1, PP_GRAPHICS3DATTRIB_NONE); 507 std::vector<int32> attribs(1, PP_GRAPHICS3DATTRIB_NONE);
508 command_buffer_ = channel_->CreateOffscreenCommandBuffer( 508 command_buffer_ = channel_->CreateOffscreenCommandBuffer(
509 gfx::Size(), nullptr, attribs, GURL::EmptyGURL(), 509 gfx::Size(), nullptr, attribs, GURL::EmptyGURL(),
510 gfx::PreferIntegratedGpu); 510 gfx::PreferIntegratedGpu);
511 if (!command_buffer_) { 511 if (!command_buffer_) {
512 Close(); 512 Close();
513 return false; 513 return false;
514 } 514 }
515 515
516 command_buffer_->SetChannelErrorCallback(media::BindToCurrentLoop( 516 command_buffer_->SetContextLostCallback(media::BindToCurrentLoop(
517 base::Bind(&PepperVideoEncoderHost::NotifyPepperError, 517 base::Bind(&PepperVideoEncoderHost::NotifyPepperError,
518 weak_ptr_factory_.GetWeakPtr(), PP_ERROR_RESOURCE_FAILED))); 518 weak_ptr_factory_.GetWeakPtr(), PP_ERROR_RESOURCE_FAILED)));
519 if (!command_buffer_->Initialize()) { 519 if (!command_buffer_->Initialize()) {
520 Close(); 520 Close();
521 return false; 521 return false;
522 } 522 }
523 523
524 return true; 524 return true;
525 } 525 }
526 526
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 } 665 }
666 666
667 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32 buffer_id) { 667 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32 buffer_id) {
668 DCHECK(RenderThreadImpl::current()); 668 DCHECK(RenderThreadImpl::current());
669 DCHECK_GE(buffer_id, 0); 669 DCHECK_GE(buffer_id, 0);
670 DCHECK_LT(buffer_id, static_cast<int32>(shm_buffers_.size())); 670 DCHECK_LT(buffer_id, static_cast<int32>(shm_buffers_.size()));
671 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory()); 671 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory());
672 } 672 }
673 673
674 } // namespace content 674 } // namespace content
OLDNEW
« no previous file with comments | « content/content_common.gypi ('k') | content/renderer/pepper/ppb_graphics_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698