mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Bug 792652 - Remove pointless OnFoo methods (r=dvander)
A bunch of these methods just delegate from OnFoo to Foo. Not sure why we have OnFoo.
This commit is contained in:
parent
bbb256b840
commit
57135907a4
@ -1859,13 +1859,13 @@ MessageChannel::MaybeUndeferIncall()
|
||||
void
|
||||
MessageChannel::EnteredCxxStack()
|
||||
{
|
||||
mListener->OnEnteredCxxStack();
|
||||
mListener->EnteredCxxStack();
|
||||
}
|
||||
|
||||
void
|
||||
MessageChannel::ExitedCxxStack()
|
||||
{
|
||||
mListener->OnExitedCxxStack();
|
||||
mListener->ExitedCxxStack();
|
||||
if (mSawInterruptOutMsg) {
|
||||
MonitorAutoLock lock(*mMonitor);
|
||||
// see long comment in OnMaybeDequeueOne()
|
||||
@ -1877,13 +1877,13 @@ MessageChannel::ExitedCxxStack()
|
||||
void
|
||||
MessageChannel::EnteredCall()
|
||||
{
|
||||
mListener->OnEnteredCall();
|
||||
mListener->EnteredCall();
|
||||
}
|
||||
|
||||
void
|
||||
MessageChannel::ExitedCall()
|
||||
{
|
||||
mListener->OnExitedCall();
|
||||
mListener->ExitedCall();
|
||||
}
|
||||
|
||||
void
|
||||
@ -1983,7 +1983,7 @@ MessageChannel::ShouldContinueFromTimeout()
|
||||
bool cont;
|
||||
{
|
||||
MonitorAutoUnlock unlock(*mMonitor);
|
||||
cont = mListener->OnReplyTimeout();
|
||||
cont = mListener->ShouldContinueFromReplyTimeout();
|
||||
mListener->ArtificialSleep();
|
||||
}
|
||||
|
||||
@ -2032,7 +2032,7 @@ void
|
||||
MessageChannel::ReportMessageRouteError(const char* channelName) const
|
||||
{
|
||||
PrintErrorMessage(mSide, channelName, "Need a route");
|
||||
mListener->OnProcessingError(MsgRouteError, "MsgRouteError");
|
||||
mListener->ProcessingError(MsgRouteError, "MsgRouteError");
|
||||
}
|
||||
|
||||
void
|
||||
@ -2074,7 +2074,7 @@ MessageChannel::ReportConnectionError(const char* aChannelName, Message* aMsg) c
|
||||
}
|
||||
|
||||
MonitorAutoUnlock unlock(*mMonitor);
|
||||
mListener->OnProcessingError(MsgDropped, errorMsg);
|
||||
mListener->ProcessingError(MsgDropped, errorMsg);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -2119,7 +2119,7 @@ MessageChannel::MaybeHandleError(Result code, const Message& aMsg, const char* c
|
||||
|
||||
PrintErrorMessage(mSide, channelName, reason);
|
||||
|
||||
mListener->OnProcessingError(code, reason);
|
||||
mListener->ProcessingError(code, reason);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -521,5 +521,11 @@ IProtocol::DeallocShmem(Shmem& aMem)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
IToplevelProtocol::IsOnCxxStack() const
|
||||
{
|
||||
return GetIPCChannel()->IsOnCxxStack();
|
||||
}
|
||||
|
||||
} // namespace ipc
|
||||
} // namespace mozilla
|
||||
|
@ -65,6 +65,8 @@ class NeckoParent;
|
||||
|
||||
namespace ipc {
|
||||
|
||||
class MessageChannel;
|
||||
|
||||
#ifdef XP_WIN
|
||||
const base::ProcessHandle kInvalidProcessHandle = INVALID_HANDLE_VALUE;
|
||||
|
||||
@ -231,9 +233,10 @@ public:
|
||||
|
||||
virtual void OnChannelClose() = 0;
|
||||
virtual void OnChannelError() = 0;
|
||||
virtual void OnProcessingError(Result aError, const char* aMsgName) = 0;
|
||||
virtual void ProcessingError(Result aError, const char* aMsgName) {}
|
||||
virtual void OnChannelConnected(int32_t peer_pid) {}
|
||||
virtual bool OnReplyTimeout() {
|
||||
|
||||
virtual bool ShouldContinueFromReplyTimeout() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -269,18 +272,13 @@ public:
|
||||
void ArtificialSleep() {}
|
||||
#endif
|
||||
|
||||
virtual void OnEnteredCxxStack() {
|
||||
NS_RUNTIMEABORT("default impl shouldn't be invoked");
|
||||
}
|
||||
virtual void OnExitedCxxStack() {
|
||||
NS_RUNTIMEABORT("default impl shouldn't be invoked");
|
||||
}
|
||||
virtual void OnEnteredCall() {
|
||||
NS_RUNTIMEABORT("default impl shouldn't be invoked");
|
||||
}
|
||||
virtual void OnExitedCall() {
|
||||
NS_RUNTIMEABORT("default impl shouldn't be invoked");
|
||||
}
|
||||
virtual void EnteredCxxStack() {}
|
||||
virtual void ExitedCxxStack() {}
|
||||
virtual void EnteredCall() {}
|
||||
virtual void ExitedCall() {}
|
||||
|
||||
bool IsOnCxxStack() const;
|
||||
|
||||
virtual RacyInterruptPolicy MediateInterruptRace(const MessageInfo& parent,
|
||||
const MessageInfo& child)
|
||||
{
|
||||
|
@ -3221,61 +3221,12 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
||||
deallocshmemvar = ExprVar('DeallocShmems')
|
||||
deallocselfvar = ExprVar('Dealloc' + _actorName(ptype.name(), self.side))
|
||||
|
||||
if ptype.isToplevel():
|
||||
# OnProcesingError(code)
|
||||
codevar = ExprVar('aCode')
|
||||
reasonvar = ExprVar('aReason')
|
||||
onprocessingerror = MethodDefn(
|
||||
MethodDecl('OnProcessingError',
|
||||
params=[ Param(_Result.Type(), codevar.name),
|
||||
Param(Type('char', const=1, ptr=1), reasonvar.name) ]))
|
||||
onprocessingerror.addstmt(StmtReturn(
|
||||
ExprCall(p.processingErrorVar(), args=[ codevar, reasonvar ])))
|
||||
self.cls.addstmts([ onprocessingerror, Whitespace.NL ])
|
||||
|
||||
# int32_t GetProtocolTypeId() { return PFoo; }
|
||||
gettypetag = MethodDefn(
|
||||
MethodDecl('GetProtocolTypeId', ret=_actorTypeTagType()))
|
||||
gettypetag.addstmt(StmtReturn(_protocolId(ptype)))
|
||||
self.cls.addstmts([ gettypetag, Whitespace.NL ])
|
||||
|
||||
if ptype.isToplevel():
|
||||
# OnReplyTimeout()
|
||||
if toplevel.isSync() or toplevel.isInterrupt():
|
||||
ontimeout = MethodDefn(
|
||||
MethodDecl('OnReplyTimeout', ret=Type.BOOL))
|
||||
ontimeout.addstmt(StmtReturn(
|
||||
ExprCall(p.shouldContinueFromTimeoutVar())))
|
||||
self.cls.addstmts([ ontimeout, Whitespace.NL ])
|
||||
|
||||
# C++-stack-related methods
|
||||
if ptype.isToplevel():
|
||||
# OnEnteredCxxStack()
|
||||
onentered = MethodDefn(MethodDecl('OnEnteredCxxStack'))
|
||||
onentered.addstmt(StmtReturn(ExprCall(p.enteredCxxStackVar())))
|
||||
|
||||
# OnExitedCxxStack()
|
||||
onexited = MethodDefn(MethodDecl('OnExitedCxxStack'))
|
||||
onexited.addstmt(StmtReturn(ExprCall(p.exitedCxxStackVar())))
|
||||
|
||||
# OnEnteredCxxStack()
|
||||
onenteredcall = MethodDefn(MethodDecl('OnEnteredCall'))
|
||||
onenteredcall.addstmt(StmtReturn(ExprCall(p.enteredCallVar())))
|
||||
|
||||
# OnExitedCxxStack()
|
||||
onexitedcall = MethodDefn(MethodDecl('OnExitedCall'))
|
||||
onexitedcall.addstmt(StmtReturn(ExprCall(p.exitedCallVar())))
|
||||
|
||||
# bool IsOnCxxStack()
|
||||
onstack = MethodDefn(
|
||||
MethodDecl(p.onCxxStackVar().name, ret=Type.BOOL, const=1))
|
||||
onstack.addstmt(StmtReturn(ExprCall(
|
||||
ExprSelect(p.channelVar(), '.', p.onCxxStackVar().name))))
|
||||
|
||||
self.cls.addstmts([ onentered, onexited,
|
||||
onenteredcall, onexitedcall,
|
||||
onstack, Whitespace.NL ])
|
||||
|
||||
if ptype.isToplevel():
|
||||
# OnChannelClose()
|
||||
onclose = MethodDefn(MethodDecl('OnChannelClose'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user