1// Copyright 2016 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.
4
5#ifndef EXTENSIONS_COMMON_ALIAS_H_
6#define EXTENSIONS_COMMON_ALIAS_H_
7
8namespace extensions {
9
10// Information about an alias.
11// Main usage: describing aliases for extension features (extension permissions,
12// APIs), which is useful for ensuring backward-compatibility of extension
13// features when they get renamed. Old feature name can be defined as an alias
14// for the new feature name - this would ensure that the extensions using the
15// old feature name don't break.
16struct Alias {
17 // This struct is meant to contain pointers to character string constants,
18 // so the lifetime of the pointer parameters should exceed that of the Alias
19 // instance.
20 constexpr Alias(const char* name, const char* real_name)
21 : name(name), real_name(real_name) {}
22
23 // The alias name.
24 const char* name;
25
26 // The real name behind the alias.
27 const char* real_name;
28};
29
30} // namespace extensions
31
32#endif // EXTENSIONS_COMMON_ALIAS_H_
33