VirtualBox

Ignore:
Timestamp:
Jun 7, 2013 11:37:03 AM (12 years ago)
Author:
vboxsync
Message:

ipcd: Avoid unnecessary work when logging is disabled.

Location:
trunk/src/libs/xpcom18a4/ipc/ipcd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/client/src/ipcdclient.cpp

    r34653 r46435  
    13101310
    13111311#ifdef IPC_LOGGING
     1312  if (IPC_LOG_ENABLED())
    13121313  {
    13131314    char *targetStr = target.ToString();
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp

    r45813 r46435  
    15811581
    15821582  nsrefcnt count = AddRef();
    1583   mRefCntLevels.Push((void *) count);
     1583  mRefCntLevels.Push((void *)(uintptr_t) count);
    15841584  return count;
    15851585}
     
    22392239{
    22402240#ifdef IPC_LOGGING
    2241   const char *name = NULL;
    2242   mIInfo->GetNameShared(&name);
    2243   LOG(("{%p} DConnectStub::<dtor>(): peer=%d instance=0x%Lx {%s}\n",
    2244        this, mPeerID, mInstance, name));
     2241  if (IPC_LOG_ENABLED())
     2242  {
     2243    const char *name = NULL;
     2244    mIInfo->GetNameShared(&name);
     2245    LOG(("{%p} DConnectStub::<dtor>(): peer=%d instance=0x%Lx {%s}\n",
     2246         this, mPeerID, mInstance, name));
     2247  }
    22452248#endif
    22462249
     
    22802283
    22812284    #ifdef IPC_LOGGING
    2282     const char *name;
    2283     mIInfo->GetNameShared(&name);
    2284     LOG(("{%p} DConnectStub::Release(): peer=%d instance=0x%Lx {%s}, new count=%d\n",
    2285         this, mPeerID, mInstance, name, count));
     2285    if (IPC_LOG_ENABLED())
     2286    {
     2287      const char *name;
     2288      mIInfo->GetNameShared(&name);
     2289      LOG(("{%p} DConnectStub::Release(): peer=%d instance=0x%Lx {%s}, new count=%d\n",
     2290          this, mPeerID, mInstance, name, count));
     2291    }
    22862292    #endif
    22872293
     
    24382444
    24392445#ifdef IPC_LOGGING
     2446  if (IPC_LOG_ENABLED())
    24402447  {
    24412448    const char *name;
     
    25242531
    25252532#ifdef IPC_LOGGING
    2526   const char *name;
    2527   nsCOMPtr<nsIInterfaceInfo> iinfo;
    2528   GetInterfaceInfo(getter_AddRefs(iinfo));
    2529   iinfo->GetNameShared(&name);
    2530   LOG(("  instance=0x%Lx {%s}\n", mInstance, name));
    2531   LOG(("  name=%s\n", aInfo->GetName()));
    2532   LOG(("  param-count=%u\n", (PRUint32) paramCount));
     2533  if (IPC_LOG_ENABLED())
     2534  {
     2535    const char *name;
     2536    nsCOMPtr<nsIInterfaceInfo> iinfo;
     2537    GetInterfaceInfo(getter_AddRefs(iinfo));
     2538    iinfo->GetNameShared(&name);
     2539    LOG(("  instance=0x%Lx {%s}\n", mInstance, name));
     2540    LOG(("  name=%s\n", aInfo->GetName()));
     2541    LOG(("  param-count=%u\n", (PRUint32) paramCount));
     2542  }
    25332543#endif
    25342544
     
    30133023
    30143024#ifdef IPC_LOGGING
    3015   const char *name;
    3016   aData->InterfaceInfo()->GetNameShared(&name);
    3017   LOG(("ipcDConnectService: WARNING: deleting unreleased "
    3018        "instance=%p iface=%p {%s}\n", aData, aData->RealInstance(), name));
     3025  if (IPC_LOG_ENABLED())
     3026  {
     3027    const char *name;
     3028    aData->InterfaceInfo()->GetNameShared(&name);
     3029    LOG(("ipcDConnectService: WARNING: deleting unreleased "
     3030         "instance=%p iface=%p {%s}\n", aData, aData->RealInstance(), name));
     3031  }
    30193032#endif
    30203033
     
    32583271{
    32593272#ifdef IPC_LOGGING
    3260   const char *name;
    3261   wrapper->InterfaceInfo()->GetNameShared(&name);
    3262   LOG(("ipcDConnectService::StoreInstance(): instance=%p iface=%p {%s}\n",
    3263        wrapper, wrapper->RealInstance(), name));
     3273  if (IPC_LOG_ENABLED())
     3274  {
     3275    const char *name;
     3276    wrapper->InterfaceInfo()->GetNameShared(&name);
     3277    LOG(("ipcDConnectService::StoreInstance(): instance=%p iface=%p {%s}\n",
     3278         wrapper, wrapper->RealInstance(), name));
     3279  }
    32643280#endif
    32653281
     
    32833299
    32843300#ifdef IPC_LOGGING
    3285   const char *name;
    3286   wrapper->InterfaceInfo()->GetNameShared(&name);
    3287   LOG(("ipcDConnectService::DeleteInstance(): instance=%p iface=%p {%s}\n",
    3288        wrapper, wrapper->RealInstance(), name));
     3301  if (IPC_LOG_ENABLED())
     3302  {
     3303    const char *name;
     3304    wrapper->InterfaceInfo()->GetNameShared(&name);
     3305    LOG(("ipcDConnectService::DeleteInstance(): instance=%p iface=%p {%s}\n",
     3306         wrapper, wrapper->RealInstance(), name));
     3307  }
    32893308#endif
    32903309
     
    33253344{
    33263345#ifdef IPC_LOGGING
    3327   const char *name;
    3328   nsCOMPtr<nsIInterfaceInfo> iinfo;
    3329   stub->GetInterfaceInfo(getter_AddRefs(iinfo));
    3330   iinfo->GetNameShared(&name);
    3331   LOG(("ipcDConnectService::StoreStub(): stub=%p instance=0x%Lx {%s}\n",
    3332        stub, stub->Instance(), name));
     3346  if (IPC_LOG_ENABLED())
     3347  {
     3348    const char *name;
     3349    nsCOMPtr<nsIInterfaceInfo> iinfo;
     3350    stub->GetInterfaceInfo(getter_AddRefs(iinfo));
     3351    iinfo->GetNameShared(&name);
     3352    LOG(("ipcDConnectService::StoreStub(): stub=%p instance=0x%Lx {%s}\n",
     3353         stub, stub->Instance(), name));
     3354  }
    33333355#endif
    33343356
     
    33413363{
    33423364#ifdef IPC_LOGGING
    3343   const char *name;
    3344   nsCOMPtr<nsIInterfaceInfo> iinfo;
    3345   stub->GetInterfaceInfo(getter_AddRefs(iinfo));
    3346   iinfo->GetNameShared(&name);
    3347   LOG(("ipcDConnectService::DeleteStub(): stub=%p instance=0x%Lx {%s}\n",
    3348        stub, stub->Instance(), name));
     3365  if (IPC_LOG_ENABLED())
     3366  {
     3367    const char *name;
     3368    nsCOMPtr<nsIInterfaceInfo> iinfo;
     3369    stub->GetInterfaceInfo(getter_AddRefs(iinfo));
     3370    iinfo->GetNameShared(&name);
     3371    LOG(("ipcDConnectService::DeleteStub(): stub=%p instance=0x%Lx {%s}\n",
     3372         stub, stub->Instance(), name));
     3373  }
    33493374#endif
    33503375
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette