VirtualBox

Changeset 74219 in vbox


Ignore:
Timestamp:
Sep 12, 2018 11:40:50 AM (6 years ago)
Author:
vboxsync
Message:

Main/ExtPack: Add another extpack helper function related to IProgress objects ( a bit of a hack, skipping the version bump)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/ExtPack/ExtPack.h

    r73828 r74219  
    259259
    260260    /**
     261     * Waits until the other task is completed (including all sub-operations)
     262     * and forward all changes from the other progress to this progress. This
     263     * means sub-operation number, description, percent and so on.
     264     *
     265     * The caller is responsible for having at least the same count of
     266     * sub-operations in this progress object as there are in the other
     267     * progress object.
     268     *
     269     * If the other progress object supports cancel and this object gets any
     270     * cancel request (when here enabled as well), it will be forwarded to
     271     * the other progress object.
     272     *
     273     * Error information is automatically preserved (by transferring it to
     274     * the current thread's error information). If the caller wants to set it
     275     * as the completion state of this progress it needs to be done separately.
     276     *
     277     * @returns COM status code.
     278     * @param   pHlp            Pointer to this helper structure.
     279     * @param   pProgress       Pointer to the IProgress object reference returned
     280     *                          by pfnCreateProgress.
     281     * @param   pProgressOther  Pointer to an IProgress object reference, the one
     282     *                          to be waited for.
     283     */
     284    DECLR3CALLBACKMEMBER(uint32_t, pfnWaitOtherProgress,(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IProgress) *pProgress,
     285                                                         VBOXEXTPACK_IF_CS(IProgress) *pProgressOther));
     286
     287    /**
    261288     * Marks the whole task as complete and sets the result code.
    262289     *
  • trunk/src/VBox/Main/include/ExtPackManagerImpl.h

    r73825 r74219  
    162162                                                             const char *pcszNextOperationDescription,
    163163                                                             uint32_t uNextOperationWeight);
     164    static DECLCALLBACK(uint32_t) i_hlpWaitOtherProgress(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IProgress) *pProgress,
     165                                                         VBOXEXTPACK_IF_CS(IProgress) *pProgressOther);
    164166    static DECLCALLBACK(uint32_t) i_hlpCompleteProgress(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IProgress) *pProgress,
    165167                                                        uint32_t uResultCode);
  • trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp

    r73916 r74219  
    753753        /* pfnUpdateProgress    = */ ExtPack::i_hlpUpdateProgress,
    754754        /* pfnNextOperationProgress = */ ExtPack::i_hlpNextOperationProgress,
     755        /* pfnWaitOtherProgress = */ ExtPack::i_hlpWaitOtherProgress,
    755756        /* pfnCompleteProgress  = */ ExtPack::i_hlpCompleteProgress,
    756757        /* pfnReserved1         = */ ExtPack::i_hlpReservedN,
     
    18281829
    18291830    return pProgress->SetNextOperation(Bstr(pcszNextOperationDescription).raw(), uNextOperationWeight);
     1831}
     1832
     1833/*static*/ DECLCALLBACK(uint32_t)
     1834ExtPack::i_hlpWaitOtherProgress(PCVBOXEXTPACKHLP pHlp, VBOXEXTPACK_IF_CS(IProgress) *pProgress,
     1835                                VBOXEXTPACK_IF_CS(IProgress) *pProgressOther)
     1836{
     1837    /*
     1838     * Validate the input and get our bearings.
     1839     */
     1840    AssertPtrReturn(pProgress, (uint32_t)E_INVALIDARG);
     1841    AssertPtrReturn(pProgressOther, (uint32_t)E_INVALIDARG);
     1842
     1843    AssertPtrReturn(pHlp, (uint32_t)E_INVALIDARG);
     1844    AssertReturn(pHlp->u32Version == VBOXEXTPACKHLP_VERSION, (uint32_t)E_INVALIDARG);
     1845
     1846    Progress *pProgressInt = static_cast<Progress *>(pProgress);
     1847    return pProgressInt->i_waitForOtherProgressCompletion(pProgressOther);
    18301848}
    18311849
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