VirtualBox

Changeset 77587 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Mar 6, 2019 4:40:18 PM (6 years ago)
Author:
vboxsync
Message:

Guest Control/Main: Implemented virtual guest object methods for session status changes to allow guest objects set their internal state accordingly. The guest session's object map now also keeps a (weak) pointer to the guest objects for handling the callbacks.

Location:
trunk/src/VBox/Main/include
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h

    r77116 r77587  
    11521152class GuestObject : public GuestBase
    11531153{
     1154    friend GuestSession;
    11541155
    11551156public:
     
    11641165protected:
    11651166
    1166     virtual int i_onRemove(void) = 0;
     1167    /**
     1168     * Called by IGuestSession when the session status has been changed.
     1169     *
     1170     * @returns VBox status code.
     1171     * @param   enmSessionStatus    New session status.
     1172     */
     1173    virtual int i_onSessionStatusChange(GuestSessionStatus_T enmSessionStatus) = 0;
     1174
     1175    /**
     1176     * Called by IGuestSession right before this object gets
     1177     * unregistered (removed) from the public object list.
     1178     */
     1179    virtual int i_onUnregister(void) = 0;
    11671180
    11681181    /** Callback dispatcher -- must be implemented by the actual object. */
  • trunk/src/VBox/Main/include/GuestDirectoryImpl.h

    r76562 r77587  
    4848
    4949public:
     50    /** @name Implemented virtual methods from GuestObject.
     51     * @{ */
     52    int            i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
     53    int            i_onUnregister(void);
     54    int            i_onSessionStatusChange(GuestSessionStatus_T enmSessionStatus);
     55    /** @}  */
     56
     57public:
    5058    /** @name Public internal methods.
    5159     * @{ */
    52     int            i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    53     int            i_onRemove(void);
    54 
    5560    int            i_closeInternal(int *pGuestRc);
    5661    int            i_readInternal(ComObjPtr<GuestFsObjInfo> &fsObjInfo, int *pGuestRc);
  • trunk/src/VBox/Main/include/GuestFileImpl.h

    r77387 r77587  
    4949
    5050public:
     51    /** @name Implemented virtual methods from GuestObject.
     52     * @{ */
     53    int             i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
     54    int             i_onUnregister(void);
     55    int             i_onSessionStatusChange(GuestSessionStatus_T enmSessionStatus);
     56    /** @}  */
     57
     58public:
    5159    /** @name Public internal methods.
    5260     * @{ */
    53     int             i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    5461    int             i_closeFile(int *pGuestRc);
    5562    EventSource    *i_getEventSource(void) { return mEventSource; }
     
    5764    int             i_onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
    5865    int             i_onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
    59     int             i_onRemove(void);
    6066    int             i_openFile(uint32_t uTimeoutMS, int *pGuestRc);
    6167    int             i_queryInfo(GuestFsObjData &objData, int *prcGuest);
  • trunk/src/VBox/Main/include/GuestProcessImpl.h

    r77074 r77587  
    5151
    5252public:
     53    /** @name Implemented virtual methods from GuestObject.
     54     * @{ */
     55    int i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
     56    int i_onUnregister(void);
     57    int i_onSessionStatusChange(GuestSessionStatus_T enmSessionStatus);
     58    /** @}  */
     59
     60public:
    5361    /** @name Public internal methods.
    5462     * @{ */
    55     int i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    5663    inline int i_checkPID(uint32_t uPID);
    57     int i_onRemove(void);
    5864    int i_readData(uint32_t uHandle, uint32_t uSize, uint32_t uTimeoutMS, void *pvData, size_t cbData, uint32_t *pcbRead, int *pGuestRc);
    5965    int i_startProcess(uint32_t cMsTimeout, int *pGuestRc);
  • trunk/src/VBox/Main/include/GuestSessionImpl.h

    r77582 r77587  
    263263        /** The object type. */
    264264        SESSIONOBJECTTYPE enmType;
     265        /** Weak pointer to the object itself. */
     266        GuestObject      *pObject;
    265267    };
    266268
     
    309311    bool                    i_isStarted(void) const;
    310312    HRESULT                 i_isStartedExternal(void);
     313    static bool             i_isTerminated(GuestSessionStatus_T enmStatus);
    311314    bool                    i_isTerminated(void) const;
    312315    int                     i_onRemove(void);
     
    318321    Guest                  *i_getParent(void) { return mParent; }
    319322    uint32_t                i_getProtocolVersion(void) { return mData.mProtocolVersion; }
    320     int                     i_objectRegister(SESSIONOBJECTTYPE enmType, uint32_t *pidObject);
     323    int                     i_objectRegister(GuestObject *pObject, SESSIONOBJECTTYPE enmType, uint32_t *pidObject);
    321324    int                     i_objectUnregister(uint32_t uObjectID);
     325    int                     i_objectsUnregister(void);
     326    int                     i_objectsNotifyAboutStatusChange(GuestSessionStatus_T enmSessionStatus);
    322327    int                     i_pathRename(const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags, int *pGuestRc);
    323328    int                     i_pathUserDocuments(Utf8Str &strPath, int *prcGuest);
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