VirtualBox

Changeset 6440 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jan 22, 2008 1:35:10 PM (17 years ago)
Author:
vboxsync
Message:

Main: Better ComPtrBase::equalsTo() specialization for IUnknown (allows to avoid unnecessary QueryInterface calls which is sensitive for IPC).

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r6400 r6440  
    883883        AssertRC (vrc);
    884884
    885         vrc = SSMR3PutBool (pSSM, folder->writable());
     885        vrc = SSMR3PutBool (pSSM, !!folder->writable());
    886886        AssertRC (vrc);
    887887    }
  • trunk/src/VBox/Main/MachineImpl.cpp

    r6384 r6440  
    29592959    if (SUCCEEDED (rc))
    29602960    {
    2961         /* memorize the direct session control */
     2961        /* memorize the direct session control and cache IUnknown for it */
    29622962        mData->mSession.mDirectControl = aControl;
     2963        mData->mSession.mDirectControlUnk = aControl;
    29632964        mData->mSession.mState = SessionState_SessionOpen;
    29642965        /* associate the SessionMachine with this Machine */
     
    56635664            folderNode.setValue <Bstr> ("name", folder->name());
    56645665            folderNode.setValue <Bstr> ("hostPath", folder->hostPath());
    5665             folderNode.setValue <bool> ("writable", folder->writable());
     5666            folderNode.setValue <bool> ("writable", !!folder->writable());
    56665667        }
    56675668    }
     
    73057306
    73067307    if (aReason != Uninit::Normal)
     7308    {
    73077309        mData->mSession.mDirectControl.setNull();
     7310        mData->mSession.mDirectControlUnk.setNull();
     7311    }
    73087312    else
    73097313    {
     
    75317535    AutoMultiLock <2> alock (mParent->wlock(), this->wlock());
    75327536
    7533     if (control.equalsTo (mData->mSession.mDirectControl))
     7537    if (control.equalsTo (mData->mSession.mDirectControlUnk))
    75347538    {
    75357539        ComAssertRet (aProgress, E_POINTER);
     
    75457549        /* set direct control to NULL to release the remote instance */
    75467550        mData->mSession.mDirectControl.setNull();
     7551        mData->mSession.mDirectControlUnk.setNull();
    75477552        LogFlowThisFunc (("Direct control is set to NULL\n"));
    75487553
  • trunk/src/VBox/Main/include/MachineImpl.h

    r6384 r6440  
    103103            /** Control of the direct session opened by openSession() */
    104104            ComPtr <IInternalSessionControl> mDirectControl;
     105            /** Cached IUnknown of mDirectControl (IPC) for fast comparison */
     106            ComPtr <IUnknown> mDirectControlUnk;
    105107
    106108            typedef std::list <ComPtr <IInternalSessionControl> > RemoteControlList;
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