summaryrefslogtreecommitdiffstats
path: root/base/synchronization
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/synchronization
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/synchronization')
-rw-r--r--base/synchronization/waitable_event.h13
-rw-r--r--base/synchronization/waitable_event_watcher.h4
-rw-r--r--base/synchronization/waitable_event_watcher_posix.cc4
-rw-r--r--base/synchronization/waitable_event_watcher_win.cc4
4 files changed, 13 insertions, 12 deletions
diff --git a/base/synchronization/waitable_event.h b/base/synchronization/waitable_event.h
index 70b9da0..01b5987 100644
--- a/base/synchronization/waitable_event.h
+++ b/base/synchronization/waitable_event.h
@@ -155,20 +155,21 @@ class WaitableEvent {
std::list<Waiter*> waiters_;
};
- scoped_refptr<WaitableEventKernel> kernel_;
-
- bool SignalAll();
- bool SignalOne();
- void Enqueue(Waiter* waiter);
+ typedef std::pair<WaitableEvent*, size_t> WaiterAndIndex;
// When dealing with arrays of WaitableEvent*, we want to sort by the address
// of the WaitableEvent in order to have a globally consistent locking order.
// In that case we keep them, in sorted order, in an array of pairs where the
// second element is the index of the WaitableEvent in the original,
// unsorted, array.
- typedef std::pair<WaitableEvent*, size_t> WaiterAndIndex;
static size_t EnqueueMany(WaiterAndIndex* waitables,
size_t count, Waiter* waiter);
+
+ bool SignalAll();
+ bool SignalOne();
+ void Enqueue(Waiter* waiter);
+
+ scoped_refptr<WaitableEventKernel> kernel_;
#endif
DISALLOW_COPY_AND_ASSIGN(WaitableEvent);
diff --git a/base/synchronization/waitable_event_watcher.h b/base/synchronization/waitable_event_watcher.h
index e396368..1b93b66 100644
--- a/base/synchronization/waitable_event_watcher.h
+++ b/base/synchronization/waitable_event_watcher.h
@@ -115,8 +115,6 @@ class WaitableEventWatcher
}
private:
- WaitableEvent* event_;
-
#if defined(OS_WIN)
// ---------------------------------------------------------------------------
// The helper class exists because, if WaitableEventWatcher were to inherit
@@ -154,6 +152,8 @@ class WaitableEventWatcher
scoped_refptr<WaitableEvent::WaitableEventKernel> kernel_;
#endif
+ WaitableEvent* event_;
+
Delegate* delegate_;
};
diff --git a/base/synchronization/waitable_event_watcher_posix.cc b/base/synchronization/waitable_event_watcher_posix.cc
index 048bbd0..0d6ff26 100644
--- a/base/synchronization/waitable_event_watcher_posix.cc
+++ b/base/synchronization/waitable_event_watcher_posix.cc
@@ -118,11 +118,11 @@ class AsyncCallbackTask : public Task {
};
WaitableEventWatcher::WaitableEventWatcher()
- : event_(NULL),
- message_loop_(NULL),
+ : message_loop_(NULL),
cancel_flag_(NULL),
waiter_(NULL),
callback_task_(NULL),
+ event_(NULL),
delegate_(NULL) {
}
diff --git a/base/synchronization/waitable_event_watcher_win.cc b/base/synchronization/waitable_event_watcher_win.cc
index 9c02a4c..43e3c47 100644
--- a/base/synchronization/waitable_event_watcher_win.cc
+++ b/base/synchronization/waitable_event_watcher_win.cc
@@ -21,8 +21,8 @@ void WaitableEventWatcher::ObjectWatcherHelper::OnObjectSignaled(HANDLE h) {
WaitableEventWatcher::WaitableEventWatcher()
- : event_(NULL),
- ALLOW_THIS_IN_INITIALIZER_LIST(helper_(this)),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(helper_(this)),
+ event_(NULL),
delegate_(NULL) {
}