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

Side by Side Diff: ui/gl/gl_surface_glx.cc

Issue 14299011: Remove all but one use of WeakPtrFactory::DetachFromThread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove checks for death with correct error, which seem to fail on iOS Created 7 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 | Annotate | Revision Log
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 extern "C" { 5 extern "C" {
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 } 7 }
8 8
9 #include "ui/gl/gl_surface_glx.h" 9 #include "ui/gl/gl_surface_glx.h"
10 10
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 class SGIVideoSyncVSyncProvider 234 class SGIVideoSyncVSyncProvider
235 : public gfx::VSyncProvider, 235 : public gfx::VSyncProvider,
236 public base::SupportsWeakPtr<SGIVideoSyncVSyncProvider> { 236 public base::SupportsWeakPtr<SGIVideoSyncVSyncProvider> {
237 public: 237 public:
238 explicit SGIVideoSyncVSyncProvider(gfx::AcceleratedWidget window) 238 explicit SGIVideoSyncVSyncProvider(gfx::AcceleratedWidget window)
239 : vsync_thread_(SGIVideoSyncThread::Create()), 239 : vsync_thread_(SGIVideoSyncThread::Create()),
240 shim_((new SGIVideoSyncProviderThreadShim(window))->AsWeakPtr()), 240 shim_((new SGIVideoSyncProviderThreadShim(window))->AsWeakPtr()),
241 cancel_vsync_flag_(shim_->cancel_vsync_flag()), 241 cancel_vsync_flag_(shim_->cancel_vsync_flag()),
242 vsync_lock_(shim_->vsync_lock()) { 242 vsync_lock_(shim_->vsync_lock()) {
243 // The WeakPtr is bound to the SGIVideoSyncThread. We only use it for
244 // PostTask.
245 shim_->DetachFromThread();
246 vsync_thread_->message_loop()->PostTask( 243 vsync_thread_->message_loop()->PostTask(
247 FROM_HERE, 244 FROM_HERE,
248 base::Bind(&SGIVideoSyncProviderThreadShim::Initialize, shim_)); 245 base::Bind(&SGIVideoSyncProviderThreadShim::Initialize, shim_));
249 } 246 }
250 247
251 virtual ~SGIVideoSyncVSyncProvider() { 248 virtual ~SGIVideoSyncVSyncProvider() {
252 { 249 {
253 base::AutoLock locked(*vsync_lock_); 250 base::AutoLock locked(*vsync_lock_);
254 cancel_vsync_flag_->Set(); 251 cancel_vsync_flag_->Set();
255 } 252 }
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 612
616 void* PbufferGLSurfaceGLX::GetConfig() { 613 void* PbufferGLSurfaceGLX::GetConfig() {
617 return config_; 614 return config_;
618 } 615 }
619 616
620 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { 617 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() {
621 Destroy(); 618 Destroy();
622 } 619 }
623 620
624 } // namespace gfx 621 } // namespace gfx
OLDNEW
« no previous file with comments | « remoting/host/policy_hack/policy_watcher_linux.cc ('k') | webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698