base: Remove now-unused MessagePumpObserver.
Jankometer is the last instance of a MessagePumpObserver. Since it has been removed, MessagePumpObserver can also be removed. BUG=none R=darin@chromium.org Review URL: https://codereview.chromium.org/421173003 Cr-Commit-Position: refs/heads/master@{#288203} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288203 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@ -367,7 +367,6 @@ component("base") {
|
||||
"message_loop/message_pump_libevent.h",
|
||||
"message_loop/message_pump_mac.h",
|
||||
"message_loop/message_pump_mac.mm",
|
||||
"message_loop/message_pump_observer.h",
|
||||
"message_loop/message_pump_win.cc",
|
||||
"message_loop/message_pump_win.h",
|
||||
"metrics/field_trial.cc",
|
||||
|
@ -239,7 +239,6 @@
|
||||
'message_loop/message_pump_glib.h',
|
||||
'message_loop/message_pump_io_ios.cc',
|
||||
'message_loop/message_pump_io_ios.h',
|
||||
'message_loop/message_pump_observer.h',
|
||||
'message_loop/message_pump_libevent.cc',
|
||||
'message_loop/message_pump_libevent.h',
|
||||
'message_loop/message_pump_mac.h',
|
||||
@ -1127,7 +1126,6 @@
|
||||
'linux_util.h',
|
||||
'md5.cc',
|
||||
'md5.h',
|
||||
'message_loop/message_pump_observer.h',
|
||||
'message_loop/message_pump_libevent.cc',
|
||||
'message_loop/message_pump_libevent.h',
|
||||
'metrics/field_trial.cc',
|
||||
|
@ -662,16 +662,6 @@ void MessageLoopForUI::Attach() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
void MessageLoopForUI::AddObserver(Observer* observer) {
|
||||
static_cast<MessagePumpWin*>(pump_.get())->AddObserver(observer);
|
||||
}
|
||||
|
||||
void MessageLoopForUI::RemoveObserver(Observer* observer) {
|
||||
static_cast<MessagePumpWin*>(pump_.get())->RemoveObserver(observer);
|
||||
}
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
#if defined(USE_OZONE) || (defined(USE_X11) && !defined(USE_GLIB))
|
||||
bool MessageLoopForUI::WatchFileDescriptor(
|
||||
int fd,
|
||||
|
@ -38,7 +38,6 @@
|
||||
namespace base {
|
||||
|
||||
class HistogramBase;
|
||||
class MessagePumpObserver;
|
||||
class RunLoop;
|
||||
class ThreadTaskRunnerHandle;
|
||||
class WaitableEvent;
|
||||
@ -551,14 +550,6 @@ class BASE_EXPORT MessageLoopForUI : public MessageLoop {
|
||||
void Start();
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
typedef MessagePumpObserver Observer;
|
||||
|
||||
// Please see message_pump_win for definitions of these methods.
|
||||
void AddObserver(Observer* observer);
|
||||
void RemoveObserver(Observer* observer);
|
||||
#endif
|
||||
|
||||
#if defined(USE_OZONE) || (defined(USE_X11) && !defined(USE_GLIB))
|
||||
// Please see MessagePumpLibevent for definition.
|
||||
bool WatchFileDescriptor(
|
||||
|
@ -1,35 +0,0 @@
|
||||
// Copyright (c) 2012 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.
|
||||
|
||||
#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_OBSERVER_H
|
||||
#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_OBSERVER_H
|
||||
|
||||
#include "base/base_export.h"
|
||||
#include "base/event_types.h"
|
||||
|
||||
#if !defined(OS_WIN)
|
||||
#error Should not be here.
|
||||
#endif
|
||||
|
||||
namespace base {
|
||||
|
||||
// A MessagePumpObserver is an object that receives global
|
||||
// notifications from the UI MessageLoop with MessagePumpWin.
|
||||
//
|
||||
// NOTE: An Observer implementation should be extremely fast!
|
||||
class BASE_EXPORT MessagePumpObserver {
|
||||
public:
|
||||
// This method is called before processing a NativeEvent.
|
||||
virtual void WillProcessEvent(const NativeEvent& event) = 0;
|
||||
|
||||
// This method is called after processing a message.
|
||||
virtual void DidProcessEvent(const NativeEvent& event) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~MessagePumpObserver() {}
|
||||
};
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_OBSERVER_H
|
@ -35,22 +35,6 @@ static const int kMsgHaveWork = WM_USER + 1;
|
||||
//-----------------------------------------------------------------------------
|
||||
// MessagePumpWin public:
|
||||
|
||||
void MessagePumpWin::AddObserver(MessagePumpObserver* observer) {
|
||||
observers_.AddObserver(observer);
|
||||
}
|
||||
|
||||
void MessagePumpWin::RemoveObserver(MessagePumpObserver* observer) {
|
||||
observers_.RemoveObserver(observer);
|
||||
}
|
||||
|
||||
void MessagePumpWin::WillProcessMessage(const MSG& msg) {
|
||||
FOR_EACH_OBSERVER(MessagePumpObserver, observers_, WillProcessEvent(msg));
|
||||
}
|
||||
|
||||
void MessagePumpWin::DidProcessMessage(const MSG& msg) {
|
||||
FOR_EACH_OBSERVER(MessagePumpObserver, observers_, DidProcessEvent(msg));
|
||||
}
|
||||
|
||||
void MessagePumpWin::RunWithDispatcher(
|
||||
Delegate* delegate, MessagePumpDispatcher* dispatcher) {
|
||||
RunState s;
|
||||
@ -369,8 +353,6 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
|
||||
if (CallMsgFilter(const_cast<MSG*>(&msg), kMessageFilterCode))
|
||||
return true;
|
||||
|
||||
WillProcessMessage(msg);
|
||||
|
||||
uint32_t action = MessagePumpDispatcher::POST_DISPATCH_PERFORM_DEFAULT;
|
||||
if (state_->dispatcher)
|
||||
action = state_->dispatcher->Dispatch(msg);
|
||||
@ -381,7 +363,6 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
DidProcessMessage(msg);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "base/basictypes.h"
|
||||
#include "base/message_loop/message_pump.h"
|
||||
#include "base/message_loop/message_pump_dispatcher.h"
|
||||
#include "base/message_loop/message_pump_observer.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/win/scoped_handle.h"
|
||||
@ -28,18 +27,6 @@ class BASE_EXPORT MessagePumpWin : public MessagePump {
|
||||
MessagePumpWin() : have_work_(0), state_(NULL) {}
|
||||
virtual ~MessagePumpWin() {}
|
||||
|
||||
// Add an Observer, which will start receiving notifications immediately.
|
||||
void AddObserver(MessagePumpObserver* observer);
|
||||
|
||||
// Remove an Observer. It is safe to call this method while an Observer is
|
||||
// receiving a notification callback.
|
||||
void RemoveObserver(MessagePumpObserver* observer);
|
||||
|
||||
// Give a chance to code processing additional messages to notify the
|
||||
// message loop observers that another message has been processed.
|
||||
void WillProcessMessage(const MSG& msg);
|
||||
void DidProcessMessage(const MSG& msg);
|
||||
|
||||
// Like MessagePump::Run, but MSG objects are routed through dispatcher.
|
||||
void RunWithDispatcher(Delegate* delegate, MessagePumpDispatcher* dispatcher);
|
||||
|
||||
@ -62,8 +49,6 @@ class BASE_EXPORT MessagePumpWin : public MessagePump {
|
||||
virtual void DoRunLoop() = 0;
|
||||
int GetCurrentDelay() const;
|
||||
|
||||
ObserverList<MessagePumpObserver> observers_;
|
||||
|
||||
// The time at which delayed work should run.
|
||||
TimeTicks delayed_work_time_;
|
||||
|
||||
|
Reference in New Issue
Block a user