VirtualBox

Changeset 58552 in vbox


Ignore:
Timestamp:
Nov 3, 2015 2:55:58 PM (9 years ago)
Author:
vboxsync
Message:

pr7179. Fixes and improvement in the classes GuestSessionTask, GuestSession, GuestProcess, ThreadTask

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

Legend:

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

    r58521 r58552  
    5858    }
    5959
    60     ComObjPtr<Progress> GetProgressObject() const;
     60    const ComObjPtr<Progress>& GetProgressObject() const {return mProgress;}
    6161
    6262protected:
  • trunk/src/VBox/Main/include/ThreadTask.h

    r58519 r58552  
    4040
    4141protected:
    42     ThreadTask():m_strTaskName("GenericTask"){};
     42    ThreadTask():m_pThread(NULL), m_strTaskName("GenericTask"){};
    4343    PRTTHREAD m_pThread;
    4444    Utf8Str m_strTaskName;
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r58521 r58552  
    6565
    6666    GuestProcessTask(GuestProcess *pProcess)
    67         : mProcess(pProcess),
    68           mRC(VINF_SUCCESS) { }
     67        : ThreadTask("GenericGuestProcessTask")
     68        , mProcess(pProcess)
     69        , mRC(VINF_SUCCESS) { }
    6970
    7071    virtual ~GuestProcessTask(void) { }
     
    11361137    LogFlowThisFuncEnter();
    11371138
    1138     int vrc;
     1139    int vrc = VINF_SUCCESS;
    11391140    HRESULT hr = S_OK;
    11401141
     
    11461147        {
    11471148            delete pTask;
    1148             LogRel2(("GuestProcess: Could not create GuestProcessStartTask object \n"));
    1149             throw hr = E_FAIL;
    1150         }
    1151 
     1149            LogFlow(("GuestProcess: Could not create GuestProcessStartTask object \n"));
     1150            throw VERR_MEMOBJ_INIT_FAILED;
     1151        }
     1152        LogFlow(("GuestProcess: Successfully created GuestProcessStartTask object \n"));
    11521153        //this function delete pTask in case of exceptions, so there is no need in the call of delete operator
    11531154        hr = pTask->createThread();
     
    11571158        vrc = VERR_NO_MEMORY;
    11581159    }
    1159     catch(...)
    1160     {
    1161         LogRel2(("GuestProcess: Could not create thread for GuestProcessStartTask task \n"));
    1162         if (hr == E_FAIL)
    1163             vrc = VERR_NO_MEMORY;
     1160    catch(int eVRC)
     1161    {
     1162        vrc = eVRC;
     1163        LogFlow(("GuestSession: Could not create thread for GuestProcessStartTask task %Rrc\n", vrc));
    11641164    }
    11651165
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r58521 r58552  
    17201720
    17211721    HRESULT hr = S_OK;
    1722     int vrc;
     1722    int vrc = VINF_SUCCESS;
    17231723
    17241724    GuestSessionTaskInternalOpen* pTask = NULL;
     
    17291729        {
    17301730            delete pTask;
    1731             LogRel2(("GuestSession: Could not create GuestSessionTaskInternalOpen object \n"));
    1732             throw hr = E_FAIL;
     1731            LogFlow(("GuestSession: Could not create GuestSessionTaskInternalOpen object \n"));
     1732            throw VERR_MEMOBJ_INIT_FAILED;
    17331733        }
    17341734
     
    17431743        vrc = VERR_NO_MEMORY;
    17441744    }
    1745     catch(...)
    1746     {
    1747         LogRel2(("GuestSession: Could not create thread for GuestSessionTaskInternalOpen task \n"));
    1748         if (hr == E_FAIL)
    1749             vrc = VERR_NO_MEMORY;
     1745    catch(int eVRC)
     1746    {
     1747        vrc = eVRC;
     1748        LogFlow(("GuestSession: Could not create thread for GuestSessionTaskInternalOpen task %Rrc\n", vrc));
    17501749    }
    17511750
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r58521 r58552  
    9797
    9898    return hr;
    99 }
    100 
    101 ComObjPtr<Progress> GuestSessionTask::GetProgressObject() const
    102 {
    103     if(mProgress != NULL)
    104         return mProgress;
    105     else
    106         return NULL;
    10799}
    108100
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