diff options
author | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 05:10:48 +0000 |
---|---|---|
committer | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 05:10:48 +0000 |
commit | 94128148b2ba757e212ae34007d44f3912a2f3d2 (patch) | |
tree | 9d4310495e83a4ba568daf1cffcf580ebea1c76b /base | |
parent | 913cedfc4c6b3024e983528f7078fba7de61cb1a (diff) | |
download | chromium_src-94128148b2ba757e212ae34007d44f3912a2f3d2.zip chromium_src-94128148b2ba757e212ae34007d44f3912a2f3d2.tar.gz chromium_src-94128148b2ba757e212ae34007d44f3912a2f3d2.tar.bz2 |
Rebaseline tests whose expectations were changed by r55714.
The patch removed extra paddings inside buttons.
http://trac.webkit.org/changeset/55714
BUG=1437
TEST=none
Review URL: http://codereview.chromium.org/789003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/message_loop.cc | 20 | ||||
-rw-r--r-- | base/message_loop.h | 78 | ||||
-rw-r--r-- | base/message_loop_unittest.cc | 81 | ||||
-rw-r--r-- | base/message_pump_libevent.cc | 59 | ||||
-rw-r--r-- | base/message_pump_libevent.h | 86 | ||||
-rw-r--r-- | base/message_pump_win.cc | 20 | ||||
-rw-r--r-- | base/message_pump_win.h | 25 | ||||
-rw-r--r-- | base/tracked.h | 10 |
8 files changed, 72 insertions, 307 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc index 3b13617..7a09f38 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -149,16 +149,6 @@ void MessageLoop::RemoveDestructionObserver(DestructionObserver *obs) { destruction_observers_.RemoveObserver(obs); } -void MessageLoop::AddTaskObserver(TaskObserver *obs) { - DCHECK_EQ(this, current()); - task_observers_.AddObserver(obs); -} - -void MessageLoop::RemoveTaskObserver(TaskObserver *obs) { - DCHECK_EQ(this, current()); - task_observers_.RemoveObserver(obs); -} - void MessageLoop::Run() { AutoRunState save_state(this); RunHandler(); @@ -335,10 +325,7 @@ void MessageLoop::RunTask(Task* task) { nestable_tasks_allowed_ = false; HistogramEvent(kTaskRunEvent); - FOR_EACH_OBSERVER(TaskObserver, task_observers_, - WillProcessTask(task->tracked_birth_time())); task->Run(); - FOR_EACH_OBSERVER(TaskObserver, task_observers_, DidProcessTask()); delete task; nestable_tasks_allowed_ = true; @@ -597,9 +584,16 @@ const LinearHistogram::DescriptionPair MessageLoop::event_descriptions_[] = { // MessageLoopForUI #if defined(OS_WIN) +void MessageLoopForUI::WillProcessMessage(const MSG& message) { + pump_win()->WillProcessMessage(message); +} void MessageLoopForUI::DidProcessMessage(const MSG& message) { pump_win()->DidProcessMessage(message); } +void MessageLoopForUI::PumpOutPendingPaintMessages() { + pump_ui()->PumpOutPendingPaintMessages(); +} + #endif // defined(OS_WIN) #if !defined(OS_MACOSX) diff --git a/base/message_loop.h b/base/message_loop.h index 8b4be7c..1a04323 100644 --- a/base/message_loop.h +++ b/base/message_loop.h @@ -8,7 +8,6 @@ #include <queue> #include <string> -#include "base/basictypes.h" #include "base/histogram.h" #include "base/message_pump.h" #include "base/observer_list.h" @@ -59,24 +58,6 @@ // class MessageLoop : public base::MessagePump::Delegate { public: - // A TaskObserver is an object that receives task notifications from the - // MessageLoop. - // - // NOTE: A TaskObserver implementation should be extremely fast! - class TaskObserver { - public: - TaskObserver() {} - - // This method is called before processing a task. - virtual void WillProcessTask(base::TimeTicks birth_time) = 0; - - // This method is called after processing a task. - virtual void DidProcessTask() = 0; - - protected: - virtual ~TaskObserver() {} - }; - static void EnableHistogrammer(bool enable_histogrammer); // A DestructionObserver is notified when the current MessageLoop is being @@ -274,14 +255,9 @@ class MessageLoop : public base::MessagePump::Delegate { // Returns true if we are currently running a nested message loop. bool IsNested(); - // These functions can only be called on the same thread that |this| is - // running on. - void AddTaskObserver(TaskObserver* task_observer); - void RemoveTaskObserver(TaskObserver* task_observer); - #if defined(OS_WIN) typedef base::MessagePumpWin::Dispatcher Dispatcher; - typedef base::MessagePumpForUI::Observer Observer; + typedef base::MessagePumpWin::Observer Observer; #elif !defined(OS_MACOSX) typedef base::MessagePumpForUI::Dispatcher Dispatcher; typedef base::MessagePumpForUI::Observer Observer; @@ -457,8 +433,6 @@ class MessageLoop : public base::MessagePump::Delegate { // The next sequence number to use for delayed tasks. int next_sequence_num_; - ObserverList<TaskObserver> task_observers_; - DISALLOW_COPY_AND_ASSIGN(MessageLoop); }; @@ -482,8 +456,10 @@ class MessageLoopForUI : public MessageLoop { } #if defined(OS_WIN) + void WillProcessMessage(const MSG& message); void DidProcessMessage(const MSG& message); -#endif // defined(OS_WIN) + void PumpOutPendingPaintMessages(); +#endif #if !defined(OS_MACOSX) // Please see message_pump_win/message_pump_glib for definitions of these @@ -497,7 +473,7 @@ class MessageLoopForUI : public MessageLoop { base::MessagePumpForUI* pump_ui() { return static_cast<base::MessagePumpForUI*>(pump_.get()); } -#endif // !defined(OS_MACOSX) +#endif // defined(OS_MACOSX) }; // Do not add any member variables to MessageLoopForUI! This is important b/c @@ -515,24 +491,6 @@ COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForUI), // class MessageLoopForIO : public MessageLoop { public: -#if defined(OS_WIN) - typedef base::MessagePumpForIO::IOHandler IOHandler; - typedef base::MessagePumpForIO::IOContext IOContext; - typedef base::MessagePumpForIO::IOObserver IOObserver; -#elif defined(OS_POSIX) - typedef base::MessagePumpLibevent::Watcher Watcher; - typedef base::MessagePumpLibevent::FileDescriptorWatcher - FileDescriptorWatcher; - typedef base::MessagePumpLibevent::IOObserver IOObserver; - - enum Mode { - WATCH_READ = base::MessagePumpLibevent::WATCH_READ, - WATCH_WRITE = base::MessagePumpLibevent::WATCH_WRITE, - WATCH_READ_WRITE = base::MessagePumpLibevent::WATCH_READ_WRITE - }; - -#endif - MessageLoopForIO() : MessageLoop(TYPE_IO) { } @@ -543,15 +501,10 @@ class MessageLoopForIO : public MessageLoop { return static_cast<MessageLoopForIO*>(loop); } - void AddIOObserver(IOObserver* io_observer) { - pump_io()->AddIOObserver(io_observer); - } - - void RemoveIOObserver(IOObserver* io_observer) { - pump_io()->RemoveIOObserver(io_observer); - } - #if defined(OS_WIN) + typedef base::MessagePumpForIO::IOHandler IOHandler; + typedef base::MessagePumpForIO::IOContext IOContext; + // Please see MessagePumpWin for definitions of these methods. void RegisterIOHandler(HANDLE file_handle, IOHandler* handler); bool WaitForIOCompletion(DWORD timeout, IOHandler* filter); @@ -563,17 +516,22 @@ class MessageLoopForIO : public MessageLoop { } #elif defined(OS_POSIX) + typedef base::MessagePumpLibevent::Watcher Watcher; + typedef base::MessagePumpLibevent::FileDescriptorWatcher + FileDescriptorWatcher; + + enum Mode { + WATCH_READ = base::MessagePumpLibevent::WATCH_READ, + WATCH_WRITE = base::MessagePumpLibevent::WATCH_WRITE, + WATCH_READ_WRITE = base::MessagePumpLibevent::WATCH_READ_WRITE + }; + // Please see MessagePumpLibevent for definition. bool WatchFileDescriptor(int fd, bool persistent, Mode mode, FileDescriptorWatcher *controller, Watcher *delegate); - - private: - base::MessagePumpLibevent* pump_io() { - return static_cast<base::MessagePumpLibevent*>(pump_.get()); - } #endif // defined(OS_POSIX) }; diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc index 0fa35f3..44d545f 100644 --- a/base/message_loop_unittest.cc +++ b/base/message_loop_unittest.cc @@ -2,12 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/eintr_wrapper.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/platform_thread.h" #include "base/ref_counted.h" -#include "base/task.h" #include "base/thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -1457,70 +1455,6 @@ TEST(MessageLoopTest, NonNestableDelayedInNestedLoop) { RunTest_NonNestableInNestedLoop(MessageLoop::TYPE_IO, true); } -class DummyTask : public Task { - public: - DummyTask(int num_tasks) : num_tasks_(num_tasks) {} - - virtual void Run() { - if (num_tasks_ > 1) { - MessageLoop::current()->PostTask( - FROM_HERE, - new DummyTask(num_tasks_ - 1)); - } else { - MessageLoop::current()->Quit(); - } - } - - private: - const int num_tasks_; -}; - -class DummyTaskObserver : public MessageLoop::TaskObserver { - public: - DummyTaskObserver(int num_tasks) - : num_tasks_started_(0), - num_tasks_processed_(0), - num_tasks_(num_tasks) {} - - virtual ~DummyTaskObserver() {} - - virtual void WillProcessTask(base::TimeTicks /* birth_time */) { - num_tasks_started_++; - EXPECT_LE(num_tasks_started_, num_tasks_); - EXPECT_EQ(num_tasks_started_, num_tasks_processed_ + 1); - } - - virtual void DidProcessTask() { - num_tasks_processed_++; - EXPECT_LE(num_tasks_started_, num_tasks_); - EXPECT_EQ(num_tasks_started_, num_tasks_processed_); - } - - int num_tasks_started() const { return num_tasks_started_; } - int num_tasks_processed() const { return num_tasks_processed_; } - - private: - int num_tasks_started_; - int num_tasks_processed_; - const int num_tasks_; - - DISALLOW_COPY_AND_ASSIGN(DummyTaskObserver); -}; - -TEST(MessageLoopTest, TaskObserver) { - const int kNumTasks = 6; - DummyTaskObserver observer(kNumTasks); - - MessageLoop loop; - loop.AddTaskObserver(&observer); - loop.PostTask(FROM_HERE, new DummyTask(kNumTasks)); - loop.Run(); - loop.RemoveTaskObserver(&observer); - - EXPECT_EQ(kNumTasks, observer.num_tasks_started()); - EXPECT_EQ(kNumTasks, observer.num_tasks_processed()); -} - #if defined(OS_WIN) TEST(MessageLoopTest, Dispatcher) { // This test requires a UI loop @@ -1545,7 +1479,8 @@ TEST(MessageLoopTest, WaitForIO) { namespace { -class QuitDelegate : public base::MessagePumpLibevent::Watcher { +class QuitDelegate : public + base::MessagePumpLibevent::Watcher { public: virtual void OnFileCanWriteWithoutBlocking(int fd) { MessageLoop::current()->Quit(); @@ -1555,6 +1490,8 @@ class QuitDelegate : public base::MessagePumpLibevent::Watcher { } }; +} // namespace + TEST(MessageLoopTest, FileDescriptorWatcherOutlivesMessageLoop) { // Simulate a MessageLoop that dies before an FileDescriptorWatcher. // This could happen when people use the Singleton pattern or atexit. @@ -1580,8 +1517,8 @@ TEST(MessageLoopTest, FileDescriptorWatcherOutlivesMessageLoop) { // and don't run the message loop, just destroy it. } } - HANDLE_EINTR(close(pipefds[0])); - HANDLE_EINTR(close(pipefds[1])); + close(pipefds[0]); + close(pipefds[1]); } TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) { @@ -1603,10 +1540,8 @@ TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) { controller.StopWatchingFileDescriptor(); } } - HANDLE_EINTR(close(pipefds[0])); - HANDLE_EINTR(close(pipefds[1])); + close(pipefds[0]); + close(pipefds[1]); } -} // namespace - #endif // defined(OS_POSIX) diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc index c2390b4..2ad1d97 100644 --- a/base/message_pump_libevent.cc +++ b/base/message_pump_libevent.cc @@ -7,10 +7,9 @@ #include <errno.h> #include <fcntl.h> +#include "eintr_wrapper.h" #include "base/auto_reset.h" -#include "base/eintr_wrapper.h" #include "base/logging.h" -#include "base/observer_list.h" #include "base/scoped_nsautorelease_pool.h" #include "base/scoped_ptr.h" #include "base/time.h" @@ -51,9 +50,7 @@ static int SetNonBlocking(int fd) { MessagePumpLibevent::FileDescriptorWatcher::FileDescriptorWatcher() : is_persistent_(false), - event_(NULL), - pump_(NULL), - watcher_(NULL) { + event_(NULL) { } MessagePumpLibevent::FileDescriptorWatcher::~FileDescriptorWatcher() { @@ -85,25 +82,9 @@ bool MessagePumpLibevent::FileDescriptorWatcher::StopWatchingFileDescriptor() { // event_del() is a no-op if the event isn't active. int rv = event_del(e); delete e; - pump_ = NULL; - watcher_ = NULL; return (rv == 0); } -void MessagePumpLibevent::FileDescriptorWatcher::OnFileCanReadWithoutBlocking( - int fd, MessagePumpLibevent* pump) { - pump->WillProcessIOEvent(); - watcher_->OnFileCanReadWithoutBlocking(fd); - pump->DidProcessIOEvent(); -} - -void MessagePumpLibevent::FileDescriptorWatcher::OnFileCanWriteWithoutBlocking( - int fd, MessagePumpLibevent* pump) { - pump->WillProcessIOEvent(); - watcher_->OnFileCanWriteWithoutBlocking(fd); - pump->DidProcessIOEvent(); -} - // Called if a byte is received on the wakeup pipe. void MessagePumpLibevent::OnWakeup(int socket, short flags, void* context) { base::MessagePumpLibevent* that = @@ -161,9 +142,9 @@ MessagePumpLibevent::~MessagePumpLibevent() { event_del(wakeup_event_); delete wakeup_event_; if (wakeup_pipe_in_ >= 0) - HANDLE_EINTR(close(wakeup_pipe_in_)); + close(wakeup_pipe_in_); if (wakeup_pipe_out_ >= 0) - HANDLE_EINTR(close(wakeup_pipe_out_)); + close(wakeup_pipe_out_); event_base_free(event_base_); } @@ -209,7 +190,7 @@ bool MessagePumpLibevent::WatchFileDescriptor(int fd, } // Set current interest mask and message pump for this event. - event_set(evt.get(), fd, event_mask, OnLibeventNotification, controller); + event_set(evt.get(), fd, event_mask, OnLibeventNotification, delegate); // Tell libevent which message pump this socket will belong to when we add it. if (event_base_set(event_base_, evt.get()) != 0) { @@ -223,25 +204,19 @@ bool MessagePumpLibevent::WatchFileDescriptor(int fd, // Transfer ownership of evt to controller. controller->Init(evt.release(), persistent); - - controller->set_watcher(delegate); - controller->set_pump(this); - return true; } + void MessagePumpLibevent::OnLibeventNotification(int fd, short flags, void* context) { - FileDescriptorWatcher* controller = - static_cast<FileDescriptorWatcher*>(context); - - MessagePumpLibevent* pump = controller->pump(); + Watcher* watcher = static_cast<Watcher*>(context); if (flags & EV_WRITE) { - controller->OnFileCanWriteWithoutBlocking(fd, pump); + watcher->OnFileCanWriteWithoutBlocking(fd); } if (flags & EV_READ) { - controller->OnFileCanReadWithoutBlocking(fd, pump); + watcher->OnFileCanReadWithoutBlocking(fd); } } @@ -329,20 +304,4 @@ void MessagePumpLibevent::ScheduleDelayedWork(const Time& delayed_work_time) { delayed_work_time_ = delayed_work_time; } -void MessagePumpLibevent::AddIOObserver(IOObserver *obs) { - io_observers_.AddObserver(obs); -} - -void MessagePumpLibevent::RemoveIOObserver(IOObserver *obs) { - io_observers_.RemoveObserver(obs); -} - -void MessagePumpLibevent::WillProcessIOEvent() { - FOR_EACH_OBSERVER(IOObserver, io_observers_, WillProcessIOEvent()); -} - -void MessagePumpLibevent::DidProcessIOEvent() { - FOR_EACH_OBSERVER(IOObserver, io_observers_, DidProcessIOEvent()); -} - } // namespace base diff --git a/base/message_pump_libevent.h b/base/message_pump_libevent.h index 6516128..8e2f77c 100644 --- a/base/message_pump_libevent.h +++ b/base/message_pump_libevent.h @@ -5,9 +5,7 @@ #ifndef BASE_MESSAGE_PUMP_LIBEVENT_H_ #define BASE_MESSAGE_PUMP_LIBEVENT_H_ -#include "base/basictypes.h" #include "base/message_pump.h" -#include "base/observer_list.h" #include "base/time.h" // Declare structs we need from libevent.h rather than including it @@ -20,19 +18,33 @@ namespace base { // TODO(dkegel): add support for background file IO somehow class MessagePumpLibevent : public MessagePump { public: - class IOObserver { - public: - IOObserver() {} - - // An IOObserver is an object that receives IO notifications from the - // MessagePump. - // - // NOTE: An IOObserver implementation should be extremely fast! - virtual void WillProcessIOEvent() = 0; - virtual void DidProcessIOEvent() = 0; - protected: - virtual ~IOObserver() {} + // Object returned by WatchFileDescriptor to manage further watching. + class FileDescriptorWatcher { + public: + FileDescriptorWatcher(); + ~FileDescriptorWatcher(); // Implicitly calls StopWatchingFileDescriptor. + + // NOTE: These methods aren't called StartWatching()/StopWatching() to + // avoid confusion with the win32 ObjectWatcher class. + + // Stop watching the FD, always safe to call. No-op if there's nothing + // to do. + bool StopWatchingFileDescriptor(); + + private: + // Called by MessagePumpLibevent, ownership of |e| is transferred to this + // object. + void Init(event* e, bool is_persistent); + + // Used by MessagePumpLibevent to take ownership of event_. + event *ReleaseEvent(); + friend class MessagePumpLibevent; + + private: + bool is_persistent_; // false if this event is one-shot. + event* event_; + DISALLOW_COPY_AND_ASSIGN(FileDescriptorWatcher); }; // Used with WatchFileDescptor to asynchronously monitor the I/O readiness of @@ -46,45 +58,6 @@ class MessagePumpLibevent : public MessagePump { virtual void OnFileCanWriteWithoutBlocking(int fd) = 0; }; - // Object returned by WatchFileDescriptor to manage further watching. - class FileDescriptorWatcher { - public: - FileDescriptorWatcher(); - ~FileDescriptorWatcher(); // Implicitly calls StopWatchingFileDescriptor. - - // NOTE: These methods aren't called StartWatching()/StopWatching() to - // avoid confusion with the win32 ObjectWatcher class. - - // Stop watching the FD, always safe to call. No-op if there's nothing - // to do. - bool StopWatchingFileDescriptor(); - - private: - friend class MessagePumpLibevent; - - // Called by MessagePumpLibevent, ownership of |e| is transferred to this - // object. - void Init(event* e, bool is_persistent); - - // Used by MessagePumpLibevent to take ownership of event_. - event *ReleaseEvent(); - - void set_pump(MessagePumpLibevent* pump) { pump_ = pump; } - MessagePumpLibevent* pump() { return pump_; } - - void set_watcher(Watcher* watcher) { watcher_ = watcher; } - - void OnFileCanReadWithoutBlocking(int fd, MessagePumpLibevent* pump); - void OnFileCanWriteWithoutBlocking(int fd, MessagePumpLibevent* pump); - - bool is_persistent_; // false if this event is one-shot. - event* event_; - MessagePumpLibevent* pump_; - Watcher* watcher_; - - DISALLOW_COPY_AND_ASSIGN(FileDescriptorWatcher); - }; - MessagePumpLibevent(); virtual ~MessagePumpLibevent(); @@ -111,9 +84,6 @@ class MessagePumpLibevent : public MessagePump { FileDescriptorWatcher *controller, Watcher *delegate); - void AddIOObserver(IOObserver* obs); - void RemoveIOObserver(IOObserver* obs); - // MessagePump methods: virtual void Run(Delegate* delegate); virtual void Quit(); @@ -121,8 +91,6 @@ class MessagePumpLibevent : public MessagePump { virtual void ScheduleDelayedWork(const Time& delayed_work_time); private: - void WillProcessIOEvent(); - void DidProcessIOEvent(); // Risky part of constructor. Returns true on success. bool Init(); @@ -154,8 +122,6 @@ class MessagePumpLibevent : public MessagePump { // ... libevent wrapper for read end event* wakeup_event_; - ObserverList<IOObserver> io_observers_; - DISALLOW_COPY_AND_ASSIGN(MessagePumpLibevent); }; diff --git a/base/message_pump_win.cc b/base/message_pump_win.cc index 6fa3e7d..1bb6cfa 100644 --- a/base/message_pump_win.cc +++ b/base/message_pump_win.cc @@ -497,11 +497,9 @@ bool MessagePumpForIO::WaitForIOCompletion(DWORD timeout, IOHandler* filter) { // Save this item for later completed_io_.push_back(item); } else { - DCHECK_EQ(item.context->handler, item.handler); - WillProcessIOEvent(); + DCHECK(item.context->handler == item.handler); item.handler->OnIOCompleted(item.context, item.bytes_transfered, item.error); - DidProcessIOEvent(); } } else { // The handler must be gone by now, just cleanup the mess. @@ -553,20 +551,4 @@ bool MessagePumpForIO::MatchCompletedIOItem(IOHandler* filter, IOItem* item) { return false; } -void MessagePumpForIO::AddIOObserver(IOObserver *obs) { - io_observers_.AddObserver(obs); -} - -void MessagePumpForIO::RemoveIOObserver(IOObserver *obs) { - io_observers_.RemoveObserver(obs); -} - -void MessagePumpForIO::WillProcessIOEvent() { - FOR_EACH_OBSERVER(IOObserver, io_observers_, WillProcessIOEvent()); -} - -void MessagePumpForIO::DidProcessIOEvent() { - FOR_EACH_OBSERVER(IOObserver, io_observers_, DidProcessIOEvent()); -} - } // namespace base diff --git a/base/message_pump_win.h b/base/message_pump_win.h index 9608187..e6ea233 100644 --- a/base/message_pump_win.h +++ b/base/message_pump_win.h @@ -9,7 +9,6 @@ #include <list> -#include "base/basictypes.h" #include "base/lock.h" #include "base/message_pump.h" #include "base/observer_list.h" @@ -24,7 +23,7 @@ namespace base { class MessagePumpWin : public MessagePump { public: // An Observer is an object that receives global notifications from the - // UI MessageLoop. + // MessageLoop. // // NOTE: An Observer implementation should be extremely fast! // @@ -284,21 +283,6 @@ class MessagePumpForIO : public MessagePumpWin { DWORD error) = 0; }; - // An IOObserver is an object that receives IO notifications from the - // MessagePump. - // - // NOTE: An IOObserver implementation should be extremely fast! - class IOObserver { - public: - IOObserver() {} - - virtual void WillProcessIOEvent() = 0; - virtual void DidProcessIOEvent() = 0; - - protected: - virtual ~IOObserver() {} - }; - // The extended context that should be used as the base structure on every // overlapped IO operation. |handler| must be set to the registered IOHandler // for the given file when the operation is started, and it can be set to NULL @@ -336,9 +320,6 @@ class MessagePumpForIO : public MessagePumpWin { // caller is willing to allow pausing regular task dispatching on this thread. bool WaitForIOCompletion(DWORD timeout, IOHandler* filter); - void AddIOObserver(IOObserver* obs); - void RemoveIOObserver(IOObserver* obs); - private: struct IOItem { IOHandler* handler; @@ -352,16 +333,12 @@ class MessagePumpForIO : public MessagePumpWin { bool MatchCompletedIOItem(IOHandler* filter, IOItem* item); bool GetIOItem(DWORD timeout, IOItem* item); bool ProcessInternalIOItem(const IOItem& item); - void WillProcessIOEvent(); - void DidProcessIOEvent(); // The completion port associated with this thread. ScopedHandle port_; // This list will be empty almost always. It stores IO completions that have // not been delivered yet because somebody was doing cleanup. std::list<IOItem> completed_io_; - - ObserverList<IOObserver> io_observers_; }; } // namespace base diff --git a/base/tracked.h b/base/tracked.h index 3622d1c..b0be729 100644 --- a/base/tracked.h +++ b/base/tracked.h @@ -107,14 +107,8 @@ class Tracked { bool MissingBirthplace() const; -#if defined(TRACK_ALL_TASK_OBJECTS) - base::TimeTicks tracked_birth_time() const { return tracked_birth_time_; } -#else - base::TimeTicks tracked_birth_time() const { return base::TimeTicks::Now(); } -#endif // defined(TRACK_ALL_TASK_OBJECTS) - private: -#if defined(TRACK_ALL_TASK_OBJECTS) +#ifdef TRACK_ALL_TASK_OBJECTS // Pointer to instance were counts of objects with the same birth location // (on the same thread) are stored. @@ -124,7 +118,7 @@ class Tracked { // reset before the object begins it active life. base::TimeTicks tracked_birth_time_; -#endif // defined(TRACK_ALL_TASK_OBJECTS) +#endif // TRACK_ALL_TASK_OBJECTS DISALLOW_COPY_AND_ASSIGN(Tracked); }; |