[M108 Migration][VD] Avoid pending frame counter becoming negative
[platform/framework/web/chromium-efl.git] / cc / metrics / custom_metrics_recorder.cc
1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/metrics/custom_metrics_recorder.h"
6
7 #include "base/check_op.h"
8
9 namespace cc {
10 namespace {
11
12 CustomMetricRecorder* g_instance = nullptr;
13
14 }  // namespace
15
16 // static
17 CustomMetricRecorder* CustomMetricRecorder::Get() {
18   return g_instance;
19 }
20
21 CustomMetricRecorder::CustomMetricRecorder() {
22   DCHECK_EQ(nullptr, g_instance);
23   g_instance = this;
24 }
25
26 CustomMetricRecorder::~CustomMetricRecorder() {
27   DCHECK_EQ(this, g_instance);
28   g_instance = nullptr;
29 }
30
31 }  // namespace cc