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

Unified Diff: cc/scoped_thread_proxy.cc

Issue 11571068: Use WeakPtr for posting cc tasks to main thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scoped_thread_proxy.h ('k') | cc/test/layer_tree_test_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scoped_thread_proxy.cc
diff --git a/cc/scoped_thread_proxy.cc b/cc/scoped_thread_proxy.cc
deleted file mode 100644
index 03aa6de7e9ea6733c11732879815adfe562ecbda..0000000000000000000000000000000000000000
--- a/cc/scoped_thread_proxy.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/scoped_thread_proxy.h"
-
-#include "base/bind.h"
-
-namespace cc {
-
-ScopedThreadProxy::ScopedThreadProxy(cc::Thread* targetThread)
- : m_targetThread(targetThread)
- , m_shutdown(false)
-{
-}
-
-ScopedThreadProxy::~ScopedThreadProxy()
-{
-}
-
-void ScopedThreadProxy::postTask(const tracked_objects::Location& location, base::Closure cb)
-{
- m_targetThread->postTask(base::Bind(&ScopedThreadProxy::runTaskIfNotShutdown, this, cb));
-}
-
-void ScopedThreadProxy::shutdown()
-{
- DCHECK(m_targetThread->belongsToCurrentThread());
- DCHECK(!m_shutdown);
- m_shutdown = true;
-}
-
-void ScopedThreadProxy::runTaskIfNotShutdown(base::Closure cb)
-{
- // If our shutdown flag is set, it's possible that m_targetThread has already been destroyed so don't
- // touch it.
- if (m_shutdown) {
- return;
- }
- DCHECK(m_targetThread->belongsToCurrentThread());
- cb.Run();
-}
-
-} // namespace cc
« no previous file with comments | « cc/scoped_thread_proxy.h ('k') | cc/test/layer_tree_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698