Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: base/global_descriptors_posix.h

Issue 7461141: Rename BASE_API to BASE_EXPORT. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/files/file_path_watcher.h ('k') | base/json/json_reader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 BASE_GLOBAL_DESCRIPTORS_POSIX_H_ 5 #ifndef BASE_GLOBAL_DESCRIPTORS_POSIX_H_
6 #define BASE_GLOBAL_DESCRIPTORS_POSIX_H_ 6 #define BASE_GLOBAL_DESCRIPTORS_POSIX_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 16 matching lines...) Expand all
27 // overwriting the slot isn't a viable solution. 27 // overwriting the slot isn't a viable solution.
28 // 28 //
29 // We could try to fill the reserved slots as soon as possible, but this is a 29 // We could try to fill the reserved slots as soon as possible, but this is a
30 // fragile solution since global constructors etc are able to open files. 30 // fragile solution since global constructors etc are able to open files.
31 // 31 //
32 // Instead, we retreat from the idea of installing descriptors in specific 32 // Instead, we retreat from the idea of installing descriptors in specific
33 // slots and add a layer of indirection in the form of this singleton object. 33 // slots and add a layer of indirection in the form of this singleton object.
34 // It maps from an abstract key to a descriptor. If independent modules each 34 // It maps from an abstract key to a descriptor. If independent modules each
35 // need to define keys, then values should be chosen randomly so as not to 35 // need to define keys, then values should be chosen randomly so as not to
36 // collide. 36 // collide.
37 class BASE_API GlobalDescriptors { 37 class BASE_EXPORT GlobalDescriptors {
38 public: 38 public:
39 typedef uint32_t Key; 39 typedef uint32_t Key;
40 typedef std::vector<std::pair<Key, int> > Mapping; 40 typedef std::vector<std::pair<Key, int> > Mapping;
41 41
42 // Often we want a canonical descriptor for a given Key. In this case, we add 42 // Often we want a canonical descriptor for a given Key. In this case, we add
43 // the following constant to the key value: 43 // the following constant to the key value:
44 static const int kBaseDescriptor = 3; // 0, 1, 2 are already taken. 44 static const int kBaseDescriptor = 3; // 0, 1, 2 are already taken.
45 45
46 // Return the singleton instance of GlobalDescriptors. 46 // Return the singleton instance of GlobalDescriptors.
47 static GlobalDescriptors* GetInstance(); 47 static GlobalDescriptors* GetInstance();
(...skipping 13 matching lines...) Expand all
61 friend struct DefaultSingletonTraits<GlobalDescriptors>; 61 friend struct DefaultSingletonTraits<GlobalDescriptors>;
62 GlobalDescriptors(); 62 GlobalDescriptors();
63 ~GlobalDescriptors(); 63 ~GlobalDescriptors();
64 64
65 Mapping descriptors_; 65 Mapping descriptors_;
66 }; 66 };
67 67
68 } // namespace base 68 } // namespace base
69 69
70 #endif // BASE_GLOBAL_DESCRIPTORS_POSIX_H_ 70 #endif // BASE_GLOBAL_DESCRIPTORS_POSIX_H_
OLDNEW
« no previous file with comments | « base/files/file_path_watcher.h ('k') | base/json/json_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698