summaryrefslogtreecommitdiffstats
path: root/base/global_descriptors_posix.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 18:06:45 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 18:06:45 +0000
commita502bbe7a3ea0d4909e4e163ab00a1f3be483143 (patch)
treec53bf6b7492be39d1fb2eaa4cacbc74f8d0c8cb1 /base/global_descriptors_posix.h
parent8ebb7703fb1fd95f993081e674d04167fe1413fc (diff)
downloadchromium_src-a502bbe7a3ea0d4909e4e163ab00a1f3be483143.zip
chromium_src-a502bbe7a3ea0d4909e4e163ab00a1f3be483143.tar.gz
chromium_src-a502bbe7a3ea0d4909e4e163ab00a1f3be483143.tar.bz2
Start sorting methods in class declarations.
A lot of our headers are a mess and aren't organized. Impose the following order on files in the base/ directory: class Blah { each public/protected/private section: typedefs; enums; static constants; ctors; dtors; methods; overridden virtual methods; data members; }; BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6081007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/global_descriptors_posix.h')
-rw-r--r--base/global_descriptors_posix.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/base/global_descriptors_posix.h b/base/global_descriptors_posix.h
index ab2b86b..0cb5b4f 100644
--- a/base/global_descriptors_posix.h
+++ b/base/global_descriptors_posix.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -37,6 +37,8 @@ namespace base {
class GlobalDescriptors {
public:
typedef uint32_t Key;
+ typedef std::vector<std::pair<Key, int> > Mapping;
+
// Often we want a canonical descriptor for a given Key. In this case, we add
// the following constant to the key value:
static const int kBaseDescriptor = 3; // 0, 1, 2 are already taken.
@@ -46,11 +48,10 @@ class GlobalDescriptors {
// Get a descriptor given a key. It is a fatal error if the key is not known.
int Get(Key key) const;
+
// Get a descriptor give a key. Returns -1 on error.
int MaybeGet(Key key) const;
- typedef std::vector<std::pair<Key, int> > Mapping;
-
// Set the descriptor for the given key.
void Set(Key key, int fd);
@@ -59,9 +60,9 @@ class GlobalDescriptors {
}
private:
+ friend struct DefaultSingletonTraits<GlobalDescriptors>;
GlobalDescriptors();
~GlobalDescriptors();
- friend struct DefaultSingletonTraits<GlobalDescriptors>;
Mapping descriptors_;
};