LCOV - code coverage report
Current view: top level - obj-x86_64-pc-linux-gnu/ipc/ipdl - PProcessHangMonitorParent.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 21 202 10.4 %
Date: 2017-07-14 16:53:18 Functions: 5 32 15.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //
       2             : // Automatically generated by ipdlc.
       3             : // Edit at your own risk
       4             : //
       5             : 
       6             : 
       7             : #include "mozilla/PProcessHangMonitorParent.h"
       8             : #ifdef MOZ_CRASHREPORTER
       9             : #  include "nsXULAppAPI.h"
      10             : #endif
      11             : 
      12             : 
      13             : #include "nsIFile.h"
      14             : #include "GeckoProfiler.h"
      15             : 
      16             : namespace mozilla {
      17             : 
      18             : 
      19             : 
      20           0 : auto PProcessHangMonitorParent::ProcessingError(
      21             :         Result aCode,
      22             :         const char* aReason) -> void
      23             : {
      24           0 : }
      25             : 
      26           0 : auto PProcessHangMonitorParent::ShouldContinueFromReplyTimeout() -> bool
      27             : {
      28           0 :     return true;
      29             : }
      30             : 
      31           2 : auto PProcessHangMonitorParent::EnteredCxxStack() -> void
      32             : {
      33           2 : }
      34             : 
      35           2 : auto PProcessHangMonitorParent::ExitedCxxStack() -> void
      36             : {
      37           2 : }
      38             : 
      39           0 : auto PProcessHangMonitorParent::EnteredCall() -> void
      40             : {
      41           0 : }
      42             : 
      43           0 : auto PProcessHangMonitorParent::ExitedCall() -> void
      44             : {
      45           0 : }
      46             : 
      47           2 : MOZ_IMPLICIT PProcessHangMonitorParent::PProcessHangMonitorParent() :
      48             :     mozilla::ipc::IToplevelProtocol(PProcessHangMonitorMsgStart, mozilla::ipc::ParentSide),
      49             :     mChannel("PProcessHangMonitorParent", ALLOW_THIS_IN_INITIALIZER_LIST(this)),
      50           2 :     mState(PProcessHangMonitor::__Start)
      51             : {
      52           2 :     MOZ_COUNT_CTOR(PProcessHangMonitorParent);
      53           2 : }
      54             : 
      55           0 : PProcessHangMonitorParent::~PProcessHangMonitorParent()
      56             : {
      57           0 :     MOZ_COUNT_DTOR(PProcessHangMonitorParent);
      58           0 : }
      59             : 
      60           0 : auto PProcessHangMonitorParent::SendTerminateScript() -> bool
      61             : {
      62           0 :     IPC::Message* msg__ = PProcessHangMonitor::Msg_TerminateScript(MSG_ROUTING_CONTROL);
      63             : 
      64             : 
      65             : 
      66             : 
      67             : 
      68           0 :     if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) {
      69           0 :         mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
      70             :     }
      71           0 :     AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_TerminateScript", OTHER);
      72           0 :     PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_TerminateScript__ID, (&(mState)));
      73             : 
      74           0 :     bool sendok__ = (GetIPCChannel())->Send(msg__);
      75           0 :     return sendok__;
      76             : }
      77             : 
      78           0 : auto PProcessHangMonitorParent::SendBeginStartingDebugger() -> bool
      79             : {
      80           0 :     IPC::Message* msg__ = PProcessHangMonitor::Msg_BeginStartingDebugger(MSG_ROUTING_CONTROL);
      81             : 
      82             : 
      83             : 
      84             : 
      85             : 
      86           0 :     if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) {
      87           0 :         mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
      88             :     }
      89           0 :     AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_BeginStartingDebugger", OTHER);
      90           0 :     PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_BeginStartingDebugger__ID, (&(mState)));
      91             : 
      92           0 :     bool sendok__ = (GetIPCChannel())->Send(msg__);
      93           0 :     return sendok__;
      94             : }
      95             : 
      96           0 : auto PProcessHangMonitorParent::SendEndStartingDebugger() -> bool
      97             : {
      98           0 :     IPC::Message* msg__ = PProcessHangMonitor::Msg_EndStartingDebugger(MSG_ROUTING_CONTROL);
      99             : 
     100             : 
     101             : 
     102             : 
     103             : 
     104           0 :     if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) {
     105           0 :         mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
     106             :     }
     107           0 :     AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_EndStartingDebugger", OTHER);
     108           0 :     PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_EndStartingDebugger__ID, (&(mState)));
     109             : 
     110           0 :     bool sendok__ = (GetIPCChannel())->Send(msg__);
     111           0 :     return sendok__;
     112             : }
     113             : 
     114           2 : auto PProcessHangMonitorParent::SendForcePaint(
     115             :         const TabId& tabId,
     116             :         const uint64_t& aLayerObserverEpoch) -> bool
     117             : {
     118           2 :     IPC::Message* msg__ = PProcessHangMonitor::Msg_ForcePaint(MSG_ROUTING_CONTROL);
     119             : 
     120           2 :     Write(tabId, msg__);
     121             :     // Sentinel = 'tabId'
     122           2 :     (msg__)->WriteSentinel(3419081923);
     123           2 :     Write(aLayerObserverEpoch, msg__);
     124             :     // Sentinel = 'aLayerObserverEpoch'
     125           2 :     (msg__)->WriteSentinel(3446156614);
     126             : 
     127             : 
     128             : 
     129             : 
     130           2 :     if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) {
     131           0 :         mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
     132             :     }
     133           4 :     AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_ForcePaint", OTHER);
     134           2 :     PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_ForcePaint__ID, (&(mState)));
     135             : 
     136           2 :     bool sendok__ = (GetIPCChannel())->Send(msg__);
     137           4 :     return sendok__;
     138             : }
     139             : 
     140           4 : auto PProcessHangMonitorParent::GetIPCChannel() -> MessageChannel*
     141             : {
     142           4 :     return (&(mChannel));
     143             : }
     144             : 
     145           0 : auto PProcessHangMonitorParent::GetIPCChannel() const -> const MessageChannel*
     146             : {
     147           0 :     return (&(mChannel));
     148             : }
     149             : 
     150           0 : auto PProcessHangMonitorParent::RemoveManagee(
     151             :         int32_t aProtocolId,
     152             :         ProtocolBase* aListener) -> void
     153             : {
     154           0 :     FatalError("unreached");
     155           0 :     return;
     156             : }
     157             : 
     158           0 : auto PProcessHangMonitorParent::OnMessageReceived(const Message& msg__) -> PProcessHangMonitorParent::Result
     159             : {
     160           0 :     switch ((msg__).type()) {
     161             :     case PProcessHangMonitor::Msg_HangEvidence__ID:
     162             :         {
     163           0 :             if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) {
     164           0 :                 mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
     165             :             }
     166           0 :             AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_HangEvidence", OTHER);
     167             : 
     168           0 :             PickleIterator iter__(msg__);
     169           0 :             HangData data;
     170             : 
     171           0 :             if ((!(Read((&(data)), (&(msg__)), (&(iter__)))))) {
     172           0 :                 FatalError("Error deserializing 'HangData'");
     173           0 :                 return MsgValueError;
     174             :             }
     175             :             // Sentinel = 'data'
     176           0 :             if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) {
     177           0 :                 mozilla::ipc::SentinelReadError("Error deserializing 'HangData'");
     178           0 :                 return MsgValueError;
     179             :             }
     180           0 :             (msg__).EndRead(iter__, (msg__).type());
     181           0 :             PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_HangEvidence__ID, (&(mState)));
     182           0 :             if ((!(RecvHangEvidence(mozilla::Move(data))))) {
     183           0 :                 mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
     184             :                 // Error handled in mozilla::ipc::IPCResult
     185           0 :                 return MsgProcessingError;
     186             :             }
     187             : 
     188           0 :             return MsgProcessed;
     189             :         }
     190             :     case PProcessHangMonitor::Msg_ClearHang__ID:
     191             :         {
     192           0 :             if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) {
     193           0 :                 mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
     194             :             }
     195           0 :             AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_ClearHang", OTHER);
     196             : 
     197           0 :             PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_ClearHang__ID, (&(mState)));
     198           0 :             if ((!(RecvClearHang()))) {
     199           0 :                 mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
     200             :                 // Error handled in mozilla::ipc::IPCResult
     201           0 :                 return MsgProcessingError;
     202             :             }
     203             : 
     204           0 :             return MsgProcessed;
     205             :         }
     206             :     default:
     207             :         {
     208           0 :             return MsgNotKnown;
     209             :         }
     210             :     case SHMEM_CREATED_MESSAGE_TYPE:
     211             :         {
     212           0 :             FatalError("this protocol tree does not use shmem");
     213           0 :             return MsgNotKnown;
     214             :         }
     215             :     case SHMEM_DESTROYED_MESSAGE_TYPE:
     216             :         {
     217           0 :             FatalError("this protocol tree does not use shmem");
     218           0 :             return MsgNotKnown;
     219             :         }
     220             :     }
     221             : }
     222             : 
     223           0 : auto PProcessHangMonitorParent::OnMessageReceived(
     224             :         const Message& msg__,
     225             :         Message*& reply__) -> PProcessHangMonitorParent::Result
     226             : {
     227           0 :     MOZ_ASSERT_UNREACHABLE("message protocol not supported");
     228             :     return MsgNotKnown;
     229             : }
     230             : 
     231           0 : auto PProcessHangMonitorParent::OnCallReceived(
     232             :         const Message& msg__,
     233             :         Message*& reply__) -> PProcessHangMonitorParent::Result
     234             : {
     235           0 :     MOZ_ASSERT_UNREACHABLE("message protocol not supported");
     236             :     return MsgNotKnown;
     237             : }
     238             : 
     239           0 : auto PProcessHangMonitorParent::GetProtocolTypeId() -> int32_t
     240             : {
     241           0 :     return PProcessHangMonitorMsgStart;
     242             : }
     243             : 
     244           0 : auto PProcessHangMonitorParent::OnChannelClose() -> void
     245             : {
     246           0 :     DestroySubtree(NormalShutdown);
     247           0 :     DeallocSubtree();
     248           0 :     DeallocShmems();
     249           0 :     DeallocPProcessHangMonitorParent();
     250           0 : }
     251             : 
     252           0 : auto PProcessHangMonitorParent::OnChannelError() -> void
     253             : {
     254           0 :     DestroySubtree(AbnormalShutdown);
     255           0 :     DeallocSubtree();
     256           0 :     DeallocShmems();
     257           0 :     DeallocPProcessHangMonitorParent();
     258           0 : }
     259             : 
     260           0 : auto PProcessHangMonitorParent::ProtocolName() const -> const char*
     261             : {
     262           0 :     return "PProcessHangMonitorParent";
     263             : }
     264             : 
     265           0 : auto PProcessHangMonitorParent::DestroySubtree(ActorDestroyReason why) -> void
     266             : {
     267             :     // Reject owning pending promises.
     268           0 :     (GetIPCChannel())->RejectPendingPromisesForActor(this);
     269             : 
     270             :     // Finally, destroy "us".
     271           0 :     ActorDestroy(why);
     272           0 : }
     273             : 
     274           0 : auto PProcessHangMonitorParent::DeallocSubtree() -> void
     275             : {
     276           0 : }
     277             : 
     278           0 : auto PProcessHangMonitorParent::DeallocPProcessHangMonitorParent() -> void
     279             : {
     280           0 : }
     281             : 
     282           0 : auto PProcessHangMonitorParent::Write(
     283             :         const HangData& v__,
     284             :         Message* msg__) -> void
     285             : {
     286             :     typedef HangData type__;
     287           0 :     Write(int((v__).type()), msg__);
     288             :     // Sentinel = 'HangData'
     289           0 :     (msg__)->WriteSentinel(424813128);
     290             : 
     291           0 :     switch ((v__).type()) {
     292             :     case type__::TSlowScriptData:
     293             :         {
     294           0 :             Write((v__).get_SlowScriptData(), msg__);
     295             :             // Sentinel = 'TSlowScriptData'
     296           0 :             (msg__)->WriteSentinel(2725568093);
     297           0 :             return;
     298             :         }
     299             :     case type__::TPluginHangData:
     300             :         {
     301           0 :             Write((v__).get_PluginHangData(), msg__);
     302             :             // Sentinel = 'TPluginHangData'
     303           0 :             (msg__)->WriteSentinel(2781280854);
     304           0 :             return;
     305             :         }
     306             :     default:
     307             :         {
     308           0 :             FatalError("unknown union type");
     309           0 :             return;
     310             :         }
     311             :     }
     312             : }
     313             : 
     314           0 : auto PProcessHangMonitorParent::Read(
     315             :         HangData* v__,
     316             :         const Message* msg__,
     317             :         PickleIterator* iter__) -> bool
     318             : {
     319             :     typedef HangData type__;
     320             :     int type;
     321           0 :     if ((!(Read((&(type)), msg__, iter__)))) {
     322           0 :         mozilla::ipc::UnionTypeReadError("HangData");
     323           0 :         return false;
     324             :     }
     325             :     // Sentinel = 'HangData'
     326           0 :     if ((!((msg__)->ReadSentinel(iter__, 424813128)))) {
     327           0 :         mozilla::ipc::SentinelReadError("HangData");
     328           0 :         return false;
     329             :     }
     330             : 
     331           0 :     switch (type) {
     332             :     case type__::TSlowScriptData:
     333             :         {
     334           0 :             SlowScriptData tmp = SlowScriptData();
     335           0 :             (*(v__)) = tmp;
     336           0 :             if ((!(Read((&((v__)->get_SlowScriptData())), msg__, iter__)))) {
     337           0 :                 FatalError("Error deserializing Union type");
     338           0 :                 return false;
     339             :             }
     340             :             // Sentinel = 'TSlowScriptData'
     341           0 :             if ((!((msg__)->ReadSentinel(iter__, 2725568093)))) {
     342           0 :                 mozilla::ipc::SentinelReadError("Error deserializing Union type");
     343           0 :                 return false;
     344             :             }
     345           0 :             return true;
     346             :         }
     347             :     case type__::TPluginHangData:
     348             :         {
     349           0 :             PluginHangData tmp = PluginHangData();
     350           0 :             (*(v__)) = tmp;
     351           0 :             if ((!(Read((&((v__)->get_PluginHangData())), msg__, iter__)))) {
     352           0 :                 FatalError("Error deserializing Union type");
     353           0 :                 return false;
     354             :             }
     355             :             // Sentinel = 'TPluginHangData'
     356           0 :             if ((!((msg__)->ReadSentinel(iter__, 2781280854)))) {
     357           0 :                 mozilla::ipc::SentinelReadError("Error deserializing Union type");
     358           0 :                 return false;
     359             :             }
     360           0 :             return true;
     361             :         }
     362             :     default:
     363             :         {
     364           0 :             FatalError("unknown union type");
     365           0 :             return false;
     366             :         }
     367             :     }
     368             : }
     369             : 
     370           0 : auto PProcessHangMonitorParent::Write(
     371             :         const PluginHangData& v__,
     372             :         Message* msg__) -> void
     373             : {
     374           0 :     Write((v__).pluginId(), msg__);
     375             :     // Sentinel = 'pluginId'
     376           0 :     (msg__)->WriteSentinel(1563488274);
     377           0 :     Write((v__).contentProcessId(), msg__);
     378             :     // Sentinel = 'contentProcessId'
     379           0 :     (msg__)->WriteSentinel(3482197741);
     380           0 : }
     381             : 
     382           0 : auto PProcessHangMonitorParent::Read(
     383             :         PluginHangData* v__,
     384             :         const Message* msg__,
     385             :         PickleIterator* iter__) -> bool
     386             : {
     387           0 :     if ((!(Read((&((v__)->pluginId())), msg__, iter__)))) {
     388           0 :         FatalError("Error deserializing 'pluginId' (uint32_t) member of 'PluginHangData'");
     389           0 :         return false;
     390             :     }
     391             :     // Sentinel = 'pluginId'
     392           0 :     if ((!((msg__)->ReadSentinel(iter__, 1563488274)))) {
     393           0 :         mozilla::ipc::SentinelReadError("Error deserializing 'pluginId' (uint32_t) member of 'PluginHangData'");
     394           0 :         return false;
     395             :     }
     396           0 :     if ((!(Read((&((v__)->contentProcessId())), msg__, iter__)))) {
     397           0 :         FatalError("Error deserializing 'contentProcessId' (ProcessId) member of 'PluginHangData'");
     398           0 :         return false;
     399             :     }
     400             :     // Sentinel = 'contentProcessId'
     401           0 :     if ((!((msg__)->ReadSentinel(iter__, 3482197741)))) {
     402           0 :         mozilla::ipc::SentinelReadError("Error deserializing 'contentProcessId' (ProcessId) member of 'PluginHangData'");
     403           0 :         return false;
     404             :     }
     405           0 :     return true;
     406             : }
     407             : 
     408           0 : auto PProcessHangMonitorParent::Write(
     409             :         const SlowScriptData& v__,
     410             :         Message* msg__) -> void
     411             : {
     412           0 :     Write((v__).tabId(), msg__);
     413             :     // Sentinel = 'tabId'
     414           0 :     (msg__)->WriteSentinel(3419081923);
     415           0 :     Write((v__).filename(), msg__);
     416             :     // Sentinel = 'filename'
     417           0 :     (msg__)->WriteSentinel(1198638255);
     418           0 : }
     419             : 
     420           0 : auto PProcessHangMonitorParent::Read(
     421             :         SlowScriptData* v__,
     422             :         const Message* msg__,
     423             :         PickleIterator* iter__) -> bool
     424             : {
     425           0 :     if ((!(Read((&((v__)->tabId())), msg__, iter__)))) {
     426           0 :         FatalError("Error deserializing 'tabId' (TabId) member of 'SlowScriptData'");
     427           0 :         return false;
     428             :     }
     429             :     // Sentinel = 'tabId'
     430           0 :     if ((!((msg__)->ReadSentinel(iter__, 3419081923)))) {
     431           0 :         mozilla::ipc::SentinelReadError("Error deserializing 'tabId' (TabId) member of 'SlowScriptData'");
     432           0 :         return false;
     433             :     }
     434           0 :     if ((!(Read((&((v__)->filename())), msg__, iter__)))) {
     435           0 :         FatalError("Error deserializing 'filename' (nsCString) member of 'SlowScriptData'");
     436           0 :         return false;
     437             :     }
     438             :     // Sentinel = 'filename'
     439           0 :     if ((!((msg__)->ReadSentinel(iter__, 1198638255)))) {
     440           0 :         mozilla::ipc::SentinelReadError("Error deserializing 'filename' (nsCString) member of 'SlowScriptData'");
     441           0 :         return false;
     442             :     }
     443           0 :     return true;
     444             : }
     445             : 
     446             : 
     447             : 
     448             : } // namespace mozilla

Generated by: LCOV version 1.13