summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/scheduler/common/thread_type.cc
blob: cd1298b02eb1c8068187e8c3a77afd58edfafbc0 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright 2018 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.

#include "third_party/blink/renderer/platform/scheduler/public/thread_type.h"

#include "base/notreached.h"

namespace blink {

const char* GetNameForThreadType(ThreadType thread_type) {
  switch (thread_type) {
    case ThreadType::kMainThread:
      return "Main thread";
    case ThreadType::kUnspecifiedWorkerThread:
      return "unspecified worker thread";
    case ThreadType::kCompositorThread:
      // Some benchmarks depend on this value.
      return "Compositor";
    case ThreadType::kDedicatedWorkerThread:
      return "DedicatedWorker thread";
    case ThreadType::kSharedWorkerThread:
      return "SharedWorker thread";
    case ThreadType::kAnimationAndPaintWorkletThread:
      return "AnimationWorklet thread";
    case ThreadType::kServiceWorkerThread:
      return "ServiceWorker thread";
    case ThreadType::kFileThread:
      return "File thread";
    case ThreadType::kDatabaseThread:
      return "Database thread";
    case ThreadType::kOfflineAudioRenderThread:
      return "OfflineAudioRender thread";
    case ThreadType::kReverbConvolutionBackgroundThread:
      return "Reverb convolution background thread";
    case ThreadType::kHRTFDatabaseLoaderThread:
      return "HRTF database loader thread";
    case ThreadType::kTestThread:
      return "test thread";
    case ThreadType::kAudioEncoderThread:
      return "Audio encoder thread";
    case ThreadType::kVideoEncoderThread:
      return "Video encoder thread";
    case ThreadType::kOfflineAudioWorkletThread:
      return "Offline AudioWorklet thread";
    case ThreadType::kRealtimeAudioWorkletThread:
      return "Realtime AudioWorklet thread";
    case ThreadType::kSemiRealtimeAudioWorkletThread:
      return "Semi-Realtime AudioWorklet thread";
    case ThreadType::kCount:
      NOTREACHED();
      return nullptr;
  }
  return nullptr;
}

}  // namespace blink