VirtualBox

Ignore:
Timestamp:
Oct 30, 2015 9:03:19 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103842
Message:

pr7179. GuestSession, GuestProcess, GuestControl classes have been modified.

File:
1 edited

Legend:

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

    r57425 r58521  
    2727#include "GuestFileImpl.h"
    2828#include "GuestFsObjInfoImpl.h"
     29#include "ThreadTask.h"
    2930
    3031#include <iprt/isofs.h> /* For UpdateAdditions. */
     
    3637 * runs in a Main worker thread.
    3738 */
    38 class GuestSessionTask
     39class GuestSessionTask : public ThreadTask
    3940{
    4041public:
     
    4849    virtual int Run(void) = 0;
    4950    virtual int RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProgress) = 0;
     51
     52    HRESULT Init(const Utf8Str &strTaskDesc)
     53    {
     54        HRESULT hr = S_OK;
     55        setTaskDesc(strTaskDesc);
     56        hr = createAndSetProgressObject();
     57        return hr;
     58    }
     59
     60    ComObjPtr<Progress> GetProgressObject() const;
    5061
    5162protected:
     
    5667    int setProgressSuccess(void);
    5768    HRESULT setProgressErrorMsg(HRESULT hr, const Utf8Str &strMsg);
    58 
     69    inline void setTaskDesc(const Utf8Str &strTaskDesc) throw()
     70    {
     71        mDesc = strTaskDesc;
     72    }
     73
     74    HRESULT createAndSetProgressObject();
    5975protected:
    6076
     
    84100    int RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProgress);
    85101    static DECLCALLBACK(int) taskThread(RTTHREAD Thread, void *pvUser);
     102    void handler()
     103    {
     104        int vrc = SessionTaskOpen::taskThread(NULL, this);
     105    }
    86106
    87107protected:
     
    114134    int RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProgress);
    115135    static DECLCALLBACK(int) taskThread(RTTHREAD Thread, void *pvUser);
     136    void handler()
     137    {
     138        int vrc = SessionTaskCopyTo::taskThread(NULL, this);
     139    }
    116140
    117141protected:
     
    142166    int RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProgress);
    143167    static DECLCALLBACK(int) taskThread(RTTHREAD Thread, void *pvUser);
     168    void handler()
     169    {
     170        int vrc = SessionTaskCopyFrom::taskThread(NULL, this);
     171    }
    144172
    145173protected:
     
    168196    int RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProgress);
    169197    static DECLCALLBACK(int) taskThread(RTTHREAD Thread, void *pvUser);
     198    void handler()
     199    {
     200        int vrc = SessionTaskUpdateAdditions::taskThread(NULL, this);
     201    }
    170202
    171203protected:
Note: See TracChangeset for help on using the changeset viewer.

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