OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_GENERATED_RESOURCES_MAP_H_ | 5 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_GENERATED_RESOURCES_MAP_H_ |
6 #define CHROME_BROWSER_METRICS_VARIATIONS_GENERATED_RESOURCES_MAP_H_ | 6 #define CHROME_BROWSER_METRICS_VARIATIONS_GENERATED_RESOURCES_MAP_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace chrome_variations { | 10 namespace chrome_variations { |
11 | 11 |
12 // This file provides a mapping from hashes of generated resource names to their | 12 // This file provides a mapping from hashes of generated resource names to their |
13 // IDs. This mapping is achieved by having two arrays: |kResourceHashes|, a | 13 // IDs. This mapping is achieved by having two arrays: |kResourceHashes|, a |
14 // sorted array of resource name hashes; and |kResourceIndices|, an array of | 14 // sorted array of resource name hashes; and |kResourceIndices|, an array of |
15 // resource indices in the same order as |kResourceHashes|. So, if | 15 // resource indices in the same order as |kResourceHashes|. So, if |
16 // generated_resources.h contains |#define IDS_FOO 12345|, then for some index i | 16 // generated_resources.h contains |#define IDS_FOO 12345|, then for some index i |
17 // kResourceHashes[i] = HASH("IDS_FOO") and kResourceIndices[i] = 12345. | 17 // kResourceHashes[i] = HASH("IDS_FOO") and kResourceIndices[i] = 12345. |
18 | 18 |
19 extern const size_t kNumResources; | |
Alexei Svitkine (slow)
2014/07/03 17:54:40
Add a comment. Also, probably move below the comme
jwd
2014/07/07 15:52:20
Done.
| |
20 | |
19 // The definitions of the arrays are generated by generate_resources_map.py from | 21 // The definitions of the arrays are generated by generate_resources_map.py from |
20 // the content of generated_resources.h. | 22 // the content of generated_resources.h. |
21 | 23 |
22 // A sorted array of hashed generated resource names. | 24 // A sorted array of hashed generated resource names. |
23 extern const uint32_t kResourceHashes[]; | 25 extern const uint32_t kResourceHashes[]; |
24 | 26 |
25 // An array of generated resource indices. The order of this array corresponds | 27 // An array of generated resource indices. The order of this array corresponds |
26 // to the order of |kResourceHashes|. | 28 // to the order of |kResourceHashes|. |
27 extern const int kResourceIndices[]; | 29 extern const int kResourceIndices[]; |
28 | 30 |
31 int GetResourceIndex(uint32_t hash); | |
Alexei Svitkine (slow)
2014/07/03 17:54:40
Add a comment.
jwd
2014/07/07 15:52:19
Done.
| |
32 | |
29 } // namespace chrome_variations | 33 } // namespace chrome_variations |
30 | 34 |
31 #endif // CHROME_BROWSER_METRICS_VARIATIONS_GENERATED_RESOURCES_MAP_H_ | 35 #endif // CHROME_BROWSER_METRICS_VARIATIONS_GENERATED_RESOURCES_MAP_H_ |
OLD | NEW |