Add ICU message format support
[chromium-blink-merge.git] / cc / resources / single_release_callback_impl.cc
blobc19e14e58a2e83dd481c1b7018e529a3922b1cbe
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/resources/single_release_callback_impl.h"
7 #include "base/callback_helpers.h"
8 #include "base/logging.h"
9 #include "cc/trees/blocking_task_runner.h"
11 namespace cc {
13 SingleReleaseCallbackImpl::SingleReleaseCallbackImpl(
14 const ReleaseCallbackImpl& callback)
15 : callback_(callback) {
16 DCHECK(!callback_.is_null())
17 << "Use a NULL SingleReleaseCallbackImpl for an empty callback.";
20 SingleReleaseCallbackImpl::~SingleReleaseCallbackImpl() {
21 DCHECK(callback_.is_null()) << "SingleReleaseCallbackImpl was never run.";
24 void SingleReleaseCallbackImpl::Run(
25 uint32 sync_point,
26 bool is_lost,
27 BlockingTaskRunner* main_thread_task_runner) {
28 DCHECK(!callback_.is_null())
29 << "SingleReleaseCallbackImpl was run more than once.";
30 base::ResetAndReturn(&callback_)
31 .Run(sync_point, is_lost, main_thread_task_runner);
34 } // namespace cc