Changeset 85251 in vbox
- Timestamp:
- Jul 11, 2020 11:17:17 PM (4 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ProgressImpl.h
r82968 r85251 235 235 236 236 // internal helper methods 237 HRESULT i_notifyCompleteWorker(HRESULT aResultCode, const ComPtr<IVirtualBoxErrorInfo> &aErrorInfo); 237 238 double i_calcTotalPercent(); 238 239 void i_checkForAutomaticTimeout(void); -
trunk/src/VBox/Main/src-all/ProgressImpl.cpp
r85214 r85251 369 369 } 370 370 371 return notifyComplete((LONG)aResultCode, errorInfo);371 return i_notifyCompleteWorker(aResultCode, errorInfo); 372 372 } 373 373 … … 413 413 errorInfo->init(aResultCode, aIID, pcszComponent, text); 414 414 415 return notifyComplete((LONG)aResultCode, errorInfo);415 return i_notifyCompleteWorker(aResultCode, errorInfo); 416 416 } 417 417 … … 460 460 errorInfo->initEx(aResultCode, vrc, aIID, pszComponent, text); 461 461 462 return notifyComplete((LONG)aResultCode, errorInfo);462 return i_notifyCompleteWorker(aResultCode, errorInfo); 463 463 } 464 464 … … 1112 1112 HRESULT Progress::notifyComplete(LONG aResultCode, const ComPtr<IVirtualBoxErrorInfo> &aErrorInfo) 1113 1113 { 1114 HRESULT hrcOperation = (HRESULT)aResultCode; /* XPCOM has an unsigned HRESULT, upsetting Clang 11 wrt sign conv. */ 1115 LogThisFunc(("hrcOperation=%Rhrc\n", hrcOperation)); 1114 return i_notifyCompleteWorker((HRESULT)aResultCode, aErrorInfo); 1115 } 1116 1117 1118 // private internal helpers 1119 ///////////////////////////////////////////////////////////////////////////// 1120 1121 /** 1122 * Marks the operation as complete and attaches full error info. 1123 * 1124 * This is where the actual work is done, the related methods all end up here. 1125 * 1126 * @param aResultCode Operation result (error) code, must not be S_OK. 1127 * @param aErrorInfo List of arguments for the format string. 1128 * 1129 * @note This is just notifyComplete with the correct aResultCode type. 1130 */ 1131 HRESULT Progress::i_notifyCompleteWorker(HRESULT aResultCode, const ComPtr<IVirtualBoxErrorInfo> &aErrorInfo) 1132 { 1133 LogThisFunc(("aResultCode=%Rhrc\n", aResultCode)); 1116 1134 /* on failure we expect error info, on success there must be none */ 1117 AssertMsg(FAILED(hrcOperation) ^ aErrorInfo.isNull(), 1118 ("No error info but trying to set a failed result (%08X)!\n", 1119 hrcOperation)); 1135 AssertMsg(FAILED(aResultCode) ^ aErrorInfo.isNull(), 1136 ("No error info but trying to set a failed result (%08X/%Rhrc)!\n", aResultCode, aResultCode)); 1120 1137 1121 1138 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1123 1140 AssertReturn(mCompleted == FALSE, E_FAIL); 1124 1141 1125 if (mCanceled && SUCCEEDED( hrcOperation))1126 hrcOperation= E_FAIL;1142 if (mCanceled && SUCCEEDED(aResultCode)) 1143 aResultCode = E_FAIL; 1127 1144 1128 1145 mCompleted = TRUE; 1129 mResultCode = hrcOperation;1130 if (SUCCEEDED( hrcOperation))1146 mResultCode = aResultCode; 1147 if (SUCCEEDED(aResultCode)) 1131 1148 { 1132 1149 m_ulCurrentOperation = m_cOperations - 1; /* last operation */ … … 1150 1167 } 1151 1168 1152 1153 // private internal helpers1154 /////////////////////////////////////////////////////////////////////////////1155 1156 1169 /** 1157 1170 * Internal helper to compute the total percent value based on the member values and
Note:
See TracChangeset
for help on using the changeset viewer.