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

Side by Side Diff: content/renderer/pepper/ppb_graphics_3d_impl.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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/pepper/ppb_graphics_3d_impl.h" 5 #include "content/renderer/pepper/ppb_graphics_3d_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 return false; 305 return false;
306 if (shared_state_handle) 306 if (shared_state_handle)
307 *shared_state_handle = command_buffer_->GetSharedStateHandle(); 307 *shared_state_handle = command_buffer_->GetSharedStateHandle();
308 if (capabilities) 308 if (capabilities)
309 *capabilities = command_buffer_->GetCapabilities(); 309 *capabilities = command_buffer_->GetCapabilities();
310 mailbox_ = gpu::Mailbox::Generate(); 310 mailbox_ = gpu::Mailbox::Generate();
311 if (!command_buffer_->ProduceFrontBuffer(mailbox_)) 311 if (!command_buffer_->ProduceFrontBuffer(mailbox_))
312 return false; 312 return false;
313 sync_point_ = command_buffer_->InsertSyncPoint(); 313 sync_point_ = command_buffer_->InsertSyncPoint();
314 314
315 command_buffer_->SetChannelErrorCallback(base::Bind( 315 command_buffer_->SetContextLostCallback(base::Bind(
316 &PPB_Graphics3D_Impl::OnContextLost, weak_ptr_factory_.GetWeakPtr())); 316 &PPB_Graphics3D_Impl::OnContextLost, weak_ptr_factory_.GetWeakPtr()));
317 317
318 command_buffer_->SetOnConsoleMessageCallback(base::Bind( 318 command_buffer_->SetOnConsoleMessageCallback(base::Bind(
319 &PPB_Graphics3D_Impl::OnConsoleMessage, weak_ptr_factory_.GetWeakPtr())); 319 &PPB_Graphics3D_Impl::OnConsoleMessage, weak_ptr_factory_.GetWeakPtr()));
320 return true; 320 return true;
321 } 321 }
322 322
323 void PPB_Graphics3D_Impl::OnConsoleMessage(const std::string& message, int id) { 323 void PPB_Graphics3D_Impl::OnConsoleMessage(const std::string& message, int id) {
324 if (!bound_to_instance_) 324 if (!bound_to_instance_)
325 return; 325 return;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); 378 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE));
379 // We have to check *again* that the instance exists, because it could have 379 // We have to check *again* that the instance exists, because it could have
380 // been deleted during GetPluginInterface(). Even the PluginModule could be 380 // been deleted during GetPluginInterface(). Even the PluginModule could be
381 // deleted, but in that case, the instance should also be gone, so the 381 // deleted, but in that case, the instance should also be gone, so the
382 // GetInstance check covers both cases. 382 // GetInstance check covers both cases.
383 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) 383 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance))
384 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); 384 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance);
385 } 385 }
386 386
387 } // namespace content 387 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_video_encoder_host.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698