Upstream changes for NetworkQualityProvider
[chromium-blink-merge.git] / net / der / tag.cc
bloba8240243943b2ab9339ae8021612efcee60990f2
1 // Copyright 2015 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 #include "base/logging.h"
6 #include "net/der/tag.h"
8 namespace net {
10 namespace der {
12 Tag ContextSpecificConstructed(uint8_t class_number) {
13 DCHECK_EQ(class_number, class_number & kTagNumberMask);
14 return (class_number & kTagNumberMask) | kTagConstructed |
15 kTagContextSpecific;
18 Tag ContextSpecificPrimitive(uint8_t base) {
19 DCHECK_EQ(base, base & kTagNumberMask);
20 return (base & kTagNumberMask) | kTagPrimitive | kTagContextSpecific;
23 bool IsConstructed(Tag tag) {
24 return (tag & kTagConstructionMask) == kTagConstructed;
27 } // namespace der
29 } // namespace net