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

Unified Diff: cc/resources/scoped_release_callback.h

Issue 23648014: cc: Move TextureMailbox::ReleaseCallback to SingleReleaseCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: releasecallback: dchecks Created 7 years, 3 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
Index: cc/resources/scoped_release_callback.h
diff --git a/cc/resources/scoped_release_callback.h b/cc/resources/scoped_release_callback.h
new file mode 100644
index 0000000000000000000000000000000000000000..3fa1c874218725e4fdfb499deefd1a17a9a4f9ef
--- /dev/null
+++ b/cc/resources/scoped_release_callback.h
@@ -0,0 +1,33 @@
+// Copyright 2013 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.
+
+#ifndef CC_RESOURCES_SCOPED_RELEASE_CALLBACK_H_
+#define CC_RESOURCES_SCOPED_RELEASE_CALLBACK_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "cc/base/cc_export.h"
+#include "cc/resources/release_callback.h"
+
+namespace cc {
+
+class CC_EXPORT ScopedReleaseCallback {
+ public:
+ static scoped_ptr<ScopedReleaseCallback> Create(const ReleaseCallback& cb) {
+ return make_scoped_ptr(new ScopedReleaseCallback(cb));
+ }
+
+ ~ScopedReleaseCallback();
+
+ void Run(unsigned sync_point, bool is_lost);
+
+ private:
+ explicit ScopedReleaseCallback(const ReleaseCallback& callback);
+
+ bool has_been_run_;
+ ReleaseCallback callback_;
+};
+
+} // namespace cc
+
+#endif // CC_RESOURCES_SCOPED_RELEASE_CALLBACK_H_

Powered by Google App Engine
This is Rietveld 408576698