Bug 1451363 - part 3 - make OnChannelReceivedMessage defined in early beta only; r=mccr8
authorNathan Froyd <froydnj@mozilla.com>
Mon, 23 Apr 2018 14:13:37 -0400
changeset 415149 ea228cf8cee53b56a8e0d493d2ee985256e97bc9
parent 415148 3978808c33d927f83929f76688e9c39e185a8a4b
child 415150 ccddb56135e6123ea6ece8e6dc8193e289308f59
push id33889
push useraciure@mozilla.com
push dateTue, 24 Apr 2018 01:14:50 +0000
treeherdermozilla-central@b35a1f66c452 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1451363
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1451363 - part 3 - make OnChannelReceivedMessage defined in early beta only; r=mccr8 This function is only overriden in two places, both of which go away after early beta is done. We shouldn't be paying for its vtable entry after that point.
ipc/glue/MessageChannel.cpp
ipc/glue/ProtocolUtils.h
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -1163,17 +1163,19 @@ void
 MessageChannel::OnMessageReceivedFromLink(Message&& aMsg)
 {
     AssertLinkThread();
     mMonitor->AssertCurrentThreadOwns();
 
     if (MaybeInterceptSpecialIOMessage(aMsg))
         return;
 
+#ifdef EARLY_BETA_OR_EARLIER
     mListener->OnChannelReceivedMessage(aMsg);
+#endif
 
     // Regardless of the Interrupt stack, if we're awaiting a sync reply,
     // we know that it needs to be immediately handled to unblock us.
     if (aMsg.is_sync() && aMsg.is_reply()) {
         IPC_LOG("Received reply seqno=%d xid=%d", aMsg.seqno(), aMsg.transaction_id());
 
         if (aMsg.seqno() == mTimedOutMessageSeqno) {
             // Drop the message, but allow future sync messages to be sent.
--- a/ipc/glue/ProtocolUtils.h
+++ b/ipc/glue/ProtocolUtils.h
@@ -531,17 +531,22 @@ public:
     // when it's difficult to determine an EventTarget ahead of time. See the
     // comment in nsILabelableRunnable.h for more information.
     virtual bool
     GetMessageSchedulerGroups(const Message& aMsg, SchedulerGroupSet& aGroups)
     {
         return false;
     }
 
+    // This method is only used for collecting telemetry bits in various places,
+    // and we shouldn't pay the overhead of having it in protocol vtables when
+    // it's not being used.
+#ifdef EARLY_BETA_OR_EARLIER
     virtual void OnChannelReceivedMessage(const Message& aMsg) {}
+#endif
 
     bool IsMainThreadProtocol() const { return mIsMainThreadProtocol; }
     void SetIsMainThreadProtocol() { mIsMainThreadProtocol = NS_IsMainThread(); }
 
     already_AddRefed<nsIEventTarget>
     GetMessageEventTarget(const Message& aMsg)
     {
         return DowncastState()->GetMessageEventTarget(aMsg);