mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1051128 - Allow filtering the IPC log by toplevel protocol name (r=bent)
This commit is contained in:
parent
179cf461f2
commit
805cf2f72c
@ -37,7 +37,7 @@ union MaybeTransform {
|
||||
};
|
||||
|
||||
sync protocol PLayerTransaction {
|
||||
manager PRenderFrame or PCompositor;
|
||||
manager PCompositor or PRenderFrame;
|
||||
manages PLayer;
|
||||
manages PCompositable;
|
||||
manages PTexture;
|
||||
|
@ -251,6 +251,20 @@ LoggingEnabled()
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool
|
||||
LoggingEnabledFor(const char *aTopLevelProtocol)
|
||||
{
|
||||
#if defined(DEBUG)
|
||||
const char *filter = PR_GetEnv("MOZ_IPC_MESSAGE_LOG");
|
||||
if (!filter) {
|
||||
return false;
|
||||
}
|
||||
return strcmp(filter, "1") == 0 || strcmp(filter, aTopLevelProtocol) == 0;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
MOZ_NEVER_INLINE void
|
||||
ProtocolErrorBreakpoint(const char* aMsg);
|
||||
|
||||
|
@ -377,8 +377,9 @@ def _sideToTransportMode(side):
|
||||
elif side == 'child': mode = 'CLIENT'
|
||||
return ExprVar('mozilla::ipc::Transport::MODE_'+ mode)
|
||||
|
||||
def _ifLogging(stmts):
|
||||
iflogging = StmtIf(ExprCall(ExprVar('mozilla::ipc::LoggingEnabled')))
|
||||
def _ifLogging(topLevelProtocol, stmts):
|
||||
iflogging = StmtIf(ExprCall(ExprVar('mozilla::ipc::LoggingEnabledFor'),
|
||||
args=[ topLevelProtocol ]))
|
||||
iflogging.addifstmts(stmts)
|
||||
return iflogging
|
||||
|
||||
@ -5372,7 +5373,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
||||
def logMessage(self, md, msgptr, pfx, actor=None, receiving=False):
|
||||
actorname = _actorName(self.protocol.name, self.side)
|
||||
|
||||
return _ifLogging([ StmtExpr(ExprCall(
|
||||
topLevel = self.protocol.decl.type.toplevel().name()
|
||||
return _ifLogging(ExprLiteral.String(topLevel), [ StmtExpr(ExprCall(
|
||||
ExprSelect(msgptr, '->', 'Log'),
|
||||
args=[ ExprLiteral.String('['+ actorname +'] '+ pfx),
|
||||
self.protocol.callOtherProcess(actor),
|
||||
|
@ -280,7 +280,7 @@ class ProtocolType(IPDLType):
|
||||
self.sendSemantics = sendSemantics
|
||||
self.spawns = set() # ProtocolType
|
||||
self.opens = set() # ProtocolType
|
||||
self.managers = set() # ProtocolType
|
||||
self.managers = [] # ProtocolType
|
||||
self.manages = [ ]
|
||||
self.stateless = stateless
|
||||
self.hasDelete = False
|
||||
@ -294,7 +294,7 @@ class ProtocolType(IPDLType):
|
||||
|
||||
def addManager(self, mgrtype):
|
||||
assert mgrtype.isIPDL() and mgrtype.isProtocol()
|
||||
self.managers.add(mgrtype)
|
||||
self.managers.append(mgrtype)
|
||||
|
||||
def addSpawn(self, ptype):
|
||||
assert self.isToplevel() and ptype.isToplevel()
|
||||
@ -305,7 +305,7 @@ class ProtocolType(IPDLType):
|
||||
self.opens.add(ptype)
|
||||
|
||||
def managedBy(self, mgr):
|
||||
self.managers = mgr
|
||||
self.managers = list(mgr)
|
||||
|
||||
def toplevel(self):
|
||||
if self.isToplevel():
|
||||
|
Loading…
Reference in New Issue
Block a user