| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/resources/single_release_callback.h" | 5 #include "cc/resources/single_release_callback.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| 11 | 11 |
| 12 SingleReleaseCallback::SingleReleaseCallback(const ReleaseCallback& callback) | 12 SingleReleaseCallback::SingleReleaseCallback(const ReleaseCallback& callback) |
| 13 : callback_(callback) { | 13 : callback_(callback) { |
| 14 DCHECK(!callback_.is_null()) | 14 DCHECK(!callback_.is_null()) |
| 15 << "Use a NULL SingleReleaseCallback for an empty callback."; | 15 << "Use a NULL SingleReleaseCallback for an empty callback."; |
| 16 } | 16 } |
| 17 | 17 |
| 18 SingleReleaseCallback::~SingleReleaseCallback() { | 18 SingleReleaseCallback::~SingleReleaseCallback() { |
| 19 DCHECK(callback_.is_null()) << "SingleReleaseCallback was never run."; | 19 DCHECK(callback_.is_null()) << "SingleReleaseCallback was never run."; |
| 20 } | 20 } |
| 21 | 21 |
| 22 void SingleReleaseCallback::Run(uint32 sync_point, bool is_lost) { | 22 void SingleReleaseCallback::Run(const gpu::SyncToken& sync_token, |
| 23 bool is_lost) { |
| 23 DCHECK(!callback_.is_null()) | 24 DCHECK(!callback_.is_null()) |
| 24 << "SingleReleaseCallback was run more than once."; | 25 << "SingleReleaseCallback was run more than once."; |
| 25 base::ResetAndReturn(&callback_).Run(sync_point, is_lost); | 26 base::ResetAndReturn(&callback_).Run(sync_token, is_lost); |
| 26 } | 27 } |
| 27 | 28 |
| 28 } // namespace cc | 29 } // namespace cc |
| OLD | NEW |