1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/declarative_webrequest/request_stage.h"
7 #include "base/basictypes.h"
11 const unsigned int kActiveStages = ON_BEFORE_REQUEST |
12 ON_BEFORE_SEND_HEADERS |
16 // HighestBit<n> computes the highest bit of |n| in compile time, provided that
17 // |n| is a positive compile-time constant.
18 template <long unsigned int n>
20 COMPILE_ASSERT(n > 0, argument_is_not_a_positive_compile_time_constant);
21 enum { VALUE = HighestBit<(n >> 1)>::VALUE << 1 };
24 struct HighestBit<1> {
28 const unsigned int kLastActiveStage = HighestBit<kActiveStages>::VALUE;
30 } // namespace extensions