chromium/cc/trees/task_runner_provider.h

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_TREES_TASK_RUNNER_PROVIDER_H_
#define CC_TREES_TASK_RUNNER_PROVIDER_H_

#include <memory>
#include <string>

#include "base/check.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/platform_thread.h"
#include "cc/cc_export.h"

namespace base {
class SingleThreadTaskRunner;
}

namespace cc {

// Class responsible for controlling access to the main and impl task runners.
// Useful for assertion checks.
class CC_EXPORT TaskRunnerProvider {};

#if DCHECK_IS_ON()
class DebugScopedSetMainThreadBlocked {};
#else
class DebugScopedSetMainThreadBlocked {
 public:
  explicit DebugScopedSetMainThreadBlocked(
      TaskRunnerProvider* task_runner_provider) {}
  DebugScopedSetMainThreadBlocked(const DebugScopedSetMainThreadBlocked&) =
      delete;
  ~DebugScopedSetMainThreadBlocked() {}

  DebugScopedSetMainThreadBlocked& operator=(
      const DebugScopedSetMainThreadBlocked&) = delete;
};
#endif

}  // namespace cc

#endif  // CC_TREES_TASK_RUNNER_PROVIDER_H_