diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-11 00:50:59 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-11 00:50:59 +0000 |
commit | eae9c0623d1800201739b4be146649103a45cd93 (patch) | |
tree | 2ce42f83e18d8a0a618ffd6dbe69b1acade5bda4 /base/global_descriptors_posix.cc | |
parent | 26f0821d0a34a79e551213d56054366aab6c70f7 (diff) | |
download | chromium_src-eae9c0623d1800201739b4be146649103a45cd93.zip chromium_src-eae9c0623d1800201739b4be146649103a45cd93.tar.gz chromium_src-eae9c0623d1800201739b4be146649103a45cd93.tar.bz2 |
Order function definitions in base/ according to the header.
BUG=68682
TEST=compiles
Review URL: http://codereview.chromium.org/6085015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70975 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/global_descriptors_posix.cc')
-rw-r--r-- | base/global_descriptors_posix.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/base/global_descriptors_posix.cc b/base/global_descriptors_posix.cc index 2fe953c..65e7955 100644 --- a/base/global_descriptors_posix.cc +++ b/base/global_descriptors_posix.cc @@ -11,10 +11,6 @@ namespace base { -GlobalDescriptors::GlobalDescriptors() {} - -GlobalDescriptors::~GlobalDescriptors() {} - // static GlobalDescriptors* GlobalDescriptors::GetInstance() { typedef Singleton<base::GlobalDescriptors, @@ -23,6 +19,14 @@ GlobalDescriptors* GlobalDescriptors::GetInstance() { return GlobalDescriptorsSingleton::get(); } +int GlobalDescriptors::Get(Key key) const { + const int ret = MaybeGet(key); + + if (ret == -1) + LOG(FATAL) << "Unknown global descriptor: " << key; + return ret; +} + int GlobalDescriptors::MaybeGet(Key key) const { for (Mapping::const_iterator i = descriptors_.begin(); i != descriptors_.end(); ++i) { @@ -35,14 +39,6 @@ int GlobalDescriptors::MaybeGet(Key key) const { return kBaseDescriptor + key; } -int GlobalDescriptors::Get(Key key) const { - const int ret = MaybeGet(key); - - if (ret == -1) - LOG(FATAL) << "Unknown global descriptor: " << key; - return ret; -} - void GlobalDescriptors::Set(Key key, int fd) { for (Mapping::iterator i = descriptors_.begin(); i != descriptors_.end(); ++i) { @@ -55,4 +51,12 @@ void GlobalDescriptors::Set(Key key, int fd) { descriptors_.push_back(std::make_pair(key, fd)); } +void GlobalDescriptors::Reset(const Mapping& mapping) { + descriptors_ = mapping; +} + +GlobalDescriptors::GlobalDescriptors() {} + +GlobalDescriptors::~GlobalDescriptors() {} + } // namespace base |