summaryrefslogtreecommitdiffstats
path: root/content/utility/webthread_impl_for_utility_thread.h
blob: 15d7e57fe7dd1a2c2ba1ef4fbdefe1f97cb0a4c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2015 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 CONTENT_UTILITY_WEBTHREAD_IMPL_FOR_UTILITY_THREAD_H_
#define CONTENT_UTILITY_WEBTHREAD_IMPL_FOR_UTILITY_THREAD_H_

#include "base/memory/ref_counted.h"
#include "components/scheduler/child/webthread_base.h"

namespace content {

class WebThreadImplForUtilityThread : public scheduler::WebThreadBase {
 public:
  WebThreadImplForUtilityThread();
  ~WebThreadImplForUtilityThread() override;

  // blink::WebThread implementation.
  blink::WebScheduler* scheduler() const override;
  blink::PlatformThreadId threadId() const override;

  // WebThreadBase implementation.
  base::SingleThreadTaskRunner* TaskRunner() const override;
  scheduler::SingleThreadIdleTaskRunner* IdleTaskRunner() const override;

 private:
  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
  blink::PlatformThreadId thread_id_;

  DISALLOW_COPY_AND_ASSIGN(WebThreadImplForUtilityThread);
};

}  // namespace content

#endif  // CONTENT_UTILITY_WEBTHREAD_IMPL_FOR_UTILITY_THREAD_H_