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

Unified Diff: base/global_descriptors_posix.cc

Issue 6085015: Order function definitions in base/ according to the header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lrn2merge Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/global_descriptors_posix.h ('k') | base/hmac_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/global_descriptors_posix.cc
diff --git a/base/global_descriptors_posix.cc b/base/global_descriptors_posix.cc
index 2fe953cf00c69914676baed70d6bfd0c99ff9b17..65e795563be7c241f2f697864c1530e52b6d824b 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
« no previous file with comments | « base/global_descriptors_posix.h ('k') | base/hmac_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698