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 #ifndef TOOLS_BLINK_GC_PLUGIN_TRACING_STATUS_H_
6 #define TOOLS_BLINK_GC_PLUGIN_TRACING_STATUS_H_
8 // TracingStatus is a three-point value ordered by unneeded < unknown < needed.
11 static TracingStatus
Unneeded() { return kUnneeded
; }
12 static TracingStatus
Unknown() { return kUnknown
; }
13 static TracingStatus
Needed() { return kNeeded
; }
14 bool IsUnneeded() const { return status_
== kUnneeded
; }
15 bool IsUnknown() const { return status_
== kUnknown
; }
16 bool IsNeeded() const { return status_
== kNeeded
; }
17 TracingStatus
LUB(const TracingStatus
& other
) const {
18 return status_
> other
.status_
? status_
: other
.status_
;
20 bool operator==(const TracingStatus
& other
) const {
21 return status_
== other
.status_
;
24 enum Status
{ kUnneeded
, kUnknown
, kNeeded
};
25 TracingStatus(Status status
) : status_(status
) {}
29 #endif // TOOLS_BLINK_GC_PLUGIN_TRACING_STATUS_H_