Bug 1451363 - part 4 - consolidate generated code into IProtocol; r=mccr8
lower.py generates repetitious: SetManager(...); Register(...); // Or RegisterID. SetIPCChannel(...); calls, which are moderately sized, given that the above call sequence requires virtual calls in several places. Instead of codegenning this sequence, let's consolidate the sequence into IProtocol and change the code generator to call into the consolidated function instead.
This commit is contained in:
@@ -529,6 +529,30 @@ IProtocol::SetManager(IProtocol* aManager)
|
||||
mManager = aManager;
|
||||
}
|
||||
|
||||
void
|
||||
IProtocol::SetManagerAndRegister(IProtocol* aManager)
|
||||
{
|
||||
// Set the manager prior to registering so registering properly inherits
|
||||
// the manager's event target.
|
||||
SetManager(aManager);
|
||||
|
||||
aManager->Register(this);
|
||||
|
||||
SetIPCChannel(aManager->GetIPCChannel());
|
||||
}
|
||||
|
||||
void
|
||||
IProtocol::SetManagerAndRegister(IProtocol* aManager, int32_t aId)
|
||||
{
|
||||
// Set the manager prior to registering so registering properly inherits
|
||||
// the manager's event target.
|
||||
SetManager(aManager);
|
||||
|
||||
aManager->RegisterID(this, aId);
|
||||
|
||||
SetIPCChannel(aManager->GetIPCChannel());
|
||||
}
|
||||
|
||||
void
|
||||
IProtocol::SetEventTargetForActor(IProtocol* aActor, nsIEventTarget* aEventTarget)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user