- Timestamp:
- Jun 1, 2010 8:41:32 AM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r29934 r29937 9841 9841 9842 9842 if (!mData->mSession.mProgress.isNull()) 9843 mData->mSession.mProgress->setOtherProgressObject(aProgress , 7);9843 mData->mSession.mProgress->setOtherProgressObject(aProgress); 9844 9844 9845 9845 return S_OK; … … 9863 9863 if (mData->mSession.mProgress) 9864 9864 { 9865 mData->mSession.mProgress->clearOtherProgressObject(tr("Finalizing"), 1);9866 9865 mData->mSession.mProgress->notifyComplete((HRESULT)iResult); 9867 9866 mData->mSession.mProgress.setNull(); -
trunk/src/VBox/Main/ProgressProxyImpl.cpp
r29934 r29937 46 46 HRESULT ProgressProxy::FinalConstruct() 47 47 { 48 mcOtherProgressObjects = 1; 49 miCurOtherProgressObject = 0; 48 mfMultiOperation = false; 49 muOtherProgressStartWeight = 0; 50 muOtherProgressWeight = 0; 51 muOtherProgressStartOperation = 0; 50 52 51 53 HRESULT rc = Progress::FinalConstruct(); … … 66 68 BOOL fCancelable) 67 69 { 68 miCurOtherProgressObject = 0; 69 mcOtherProgressObjects = 0; 70 mfMultiOperation = false; 71 muOtherProgressStartWeight = 1; 72 muOtherProgressWeight = 1; 73 muOtherProgressStartOperation = 1; 70 74 71 75 return Progress::init( … … 84 88 85 89 /** 86 * Initialize for proxying one or more other objects, assuming we start out and 87 * end without proxying anyone. 88 * 89 * The user must call clearOtherProgressObject when there are no more progress 90 * objects to be proxied or we'll leave threads waiting forever. 90 * Initialize for proxying one other progress object. 91 * 92 * This is tailored explicitly for the openRemoteSession code, so we start out 93 * with one operation where we don't have any remote object (powerUp). Then a 94 * remote object is added and stays with us till the end. 95 * 96 * The user must do normal completion notification or risk leave the threads 97 * waiting forever! 91 98 */ 92 99 HRESULT ProgressProxy::init( … … 97 104 CBSTR bstrDescription, 98 105 BOOL fCancelable, 99 ULONG cOtherProgressObjects,100 106 ULONG uTotalOperationsWeight, 101 107 CBSTR bstrFirstOperationDescription, 102 108 ULONG uFirstOperationWeight, 103 OUT_GUID pId) 104 { 105 miCurOtherProgressObject = 0; 106 mcOtherProgressObjects = cOtherProgressObjects; 109 ULONG cOtherProgressObjectOperations) 110 { 111 mfMultiOperation = false; 112 muOtherProgressStartWeight = uFirstOperationWeight; 113 muOtherProgressWeight = uTotalOperationsWeight - uFirstOperationWeight; 114 muOtherProgressStartOperation = 1; 107 115 108 116 return Progress::init( … … 113 121 bstrDescription, 114 122 fCancelable, 115 1 + cOtherProgressObject s + 1/* cOperations */,123 1 + cOtherProgressObjectOperations /* cOperations */, 116 124 uTotalOperationsWeight, 117 125 bstrFirstOperationDescription, 118 126 uFirstOperationWeight, 119 pId);127 NULL); 120 128 } 121 129 … … 123 131 { 124 132 uninit(); 125 miCurOtherProgressObject = 0; 133 mfMultiOperation = false; 134 muOtherProgressStartWeight = 0; 135 muOtherProgressWeight = 0; 136 muOtherProgressStartOperation = 0; 126 137 } 127 138 … … 136 147 // Public methods 137 148 //////////////////////////////////////////////////////////////////////////////// 138 139 /** Just a wrapper so we can automatically do the handover before setting140 * the result locally. */141 HRESULT ProgressProxy::setResultCode(HRESULT aResultCode)142 {143 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);144 clearOtherProgressObjectInternal(true /* fEarly */);145 return Progress::setResultCode(aResultCode);146 }147 149 148 150 /** Just a wrapper so we can automatically do the handover before setting … … 152 154 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 153 155 clearOtherProgressObjectInternal(true /* fEarly */); 154 return Progress::notifyComplete(aResultCode); 156 HRESULT hrc = S_OK; 157 if (!mCompleted) 158 hrc = Progress::notifyComplete(aResultCode); 159 return hrc; 155 160 } 156 161 … … 166 171 clearOtherProgressObjectInternal(true /* fEarly */); 167 172 168 va_list va; 169 va_start(va, aText); 170 HRESULT hrc = Progress::notifyCompleteV(aResultCode, aIID, aComponent, aText, va); 171 va_end(va); 172 return hrc; 173 } 174 175 /** Just a wrapper so we can automatically do the handover before setting 176 * the result locally. */ 177 bool ProgressProxy::notifyPointOfNoReturn(void) 178 { 179 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 180 clearOtherProgressObjectInternal(true /* fEarly */); 181 return Progress::notifyPointOfNoReturn(); 173 HRESULT hrc = S_OK; 174 if (!mCompleted) 175 { 176 va_list va; 177 va_start(va, aText); 178 HRESULT hrc = Progress::notifyCompleteV(aResultCode, aIID, aComponent, aText, va); 179 va_end(va); 180 } 181 return hrc; 182 182 } 183 183 … … 188 188 * @returns false if failed/canceled, true if not. 189 189 * @param pOtherProgress The other progress object. Must not be NULL. 190 * @param uOperationWeight The weight of this operation. (The description191 * is taken from the other progress object.)192 190 */ 193 bool ProgressProxy::setOtherProgressObject(IProgress *pOtherProgress , ULONG uOperationWeight)194 { 195 LogFlowThisFunc(("setOtherProgressObject: %p %u\n", pOtherProgress, uOperationWeight));191 bool ProgressProxy::setOtherProgressObject(IProgress *pOtherProgress) 192 { 193 LogFlowThisFunc(("setOtherProgressObject: %p\n", pOtherProgress)); 196 194 ComPtr<IProgress> ptrOtherProgress = pOtherProgress; 197 195 198 /* Get the description first. */ 199 Bstr bstrOperationDescription; 200 HRESULT hrc = pOtherProgress->COMGETTER(Description)(bstrOperationDescription.asOutParam()); 196 /* 197 * Query information from the other progress object before we grab the 198 * lock. 199 */ 200 ULONG cOperations; 201 HRESULT hrc = pOtherProgress->COMGETTER(OperationCount)(&cOperations); 202 if (FAILED(hrc)) 203 cOperations = 1; 204 205 Bstr bstrOperationDescription; 206 hrc = pOtherProgress->COMGETTER(Description)(bstrOperationDescription.asOutParam()); 201 207 if (FAILED(hrc)) 202 208 bstrOperationDescription = "oops"; 203 209 210 211 /* 212 * Take the lock and check for cancelation, cancel the other object if 213 * we've been canceled already. 214 */ 204 215 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 205 216 206 /* Do the hand over from any previous progress object. */207 clearOtherProgressObjectInternal(false /*fEarly*/);208 217 BOOL fCompletedOrCanceled = mCompleted || mCanceled; 209 218 if (!fCompletedOrCanceled) 210 219 { 211 /* Advance to the next object and operation, checking for cancelation 212 and completion right away to be on the safe side. */ 213 Assert(miCurOtherProgressObject < mcOtherProgressObjects); 220 /* 221 * Advance to the next object and operation. If the other object has 222 * more operations than anticipated, adjust our internal count. 223 */ 214 224 mptrOtherProgress = ptrOtherProgress; 215 216 Progress::SetNextOperation(bstrOperationDescription, uOperationWeight); 217 225 mfMultiOperation = cOperations > 1; 226 227 muOtherProgressStartWeight = m_ulOperationsCompletedWeight + m_ulCurrentOperationWeight; 228 muOtherProgressWeight = m_ulTotalOperationsWeight - muOtherProgressStartWeight; 229 Progress::SetNextOperation(bstrOperationDescription, muOtherProgressWeight); 230 231 muOtherProgressStartOperation = m_ulCurrentOperation; 232 m_cOperations = cOperations + m_ulCurrentOperation; 233 234 /* 235 * Check for cancelation and completion. 236 */ 218 237 BOOL f; 219 238 hrc = ptrOtherProgress->COMGETTER(Completed)(&f); … … 233 252 else 234 253 { 235 /* Mirror the cancelable property. */ 254 /* 255 * Finally, mirror the cancelable property. 256 * Note! Note necessary if we do passthru! 257 */ 236 258 if (mCancelable) 237 259 { … … 257 279 } 258 280 259 /**260 * Clears the last other progress objects.261 *262 * @returns false if failed/canceled, true if not.263 * @param pszLastOperationDescription The description of the final bit.264 * @param uLastOperationWeight The weight of the final bit.265 */266 bool ProgressProxy::clearOtherProgressObject(const char *pszLastOperationDescription, ULONG uLastOperationWeight)267 {268 LogFlowThisFunc(("%p %u\n", pszLastOperationDescription, uLastOperationWeight));269 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);270 271 clearOtherProgressObjectInternal(false /* fEarly */);272 273 /* Advance to the next operation if applicable. */274 bool fCompletedOrCanceled = mCompleted || mCanceled;275 if (!fCompletedOrCanceled)276 Progress::SetNextOperation(Bstr(pszLastOperationDescription), uLastOperationWeight);277 278 LogFlowThisFunc(("Returns %RTbool\n", !fCompletedOrCanceled));279 return !fCompletedOrCanceled;280 }281 282 281 // Internal methods. 283 282 //////////////////////////////////////////////////////////////////////////////// … … 285 284 286 285 /** 287 * Internal version of clearOtherProgressObject that doesn't advance to the next 288 * operation. 289 * 290 * This is used both by clearOtherProgressObject as well as a number of places 291 * where we automatically do the hand over because of failure/completion. 286 * Clear the other progress object reference, first copying over its state. 287 * 288 * This is used internally when completion is signalled one way or another. 292 289 * 293 290 * @param fEarly Early clearing or not. … … 295 292 void ProgressProxy::clearOtherProgressObjectInternal(bool fEarly) 296 293 { 297 if ( !mptrOtherProgress.isNull())294 if (mptrOtherProgress.isNotNull()) 298 295 { 299 296 ComPtr<IProgress> ptrOtherProgress = mptrOtherProgress; 300 297 mptrOtherProgress.setNull(); 301 298 copyProgressInfo(ptrOtherProgress, fEarly); 302 303 miCurOtherProgressObject++;304 Assert(miCurOtherProgressObject <= mcOtherProgressObjects);305 299 } 306 300 } … … 413 407 //////////////////////////////////////////////////////////////////////////////// 414 408 409 STDMETHODIMP ProgressProxy::COMGETTER(Cancelable)(BOOL *aCancelable) 410 { 411 CheckComArgOutPointerValid(aCancelable); 412 413 AutoCaller autoCaller(this); 414 HRESULT hrc = autoCaller.rc(); 415 if (SUCCEEDED(hrc)) 416 { 417 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 418 419 /* ASSUME: The cancelable property can only change to FALSE. */ 420 if (!mCancelable || mptrOtherProgress.isNull()) 421 *aCancelable = mCancelable; 422 else 423 { 424 hrc = mptrOtherProgress->COMGETTER(Cancelable)(aCancelable); 425 if (SUCCEEDED(hrc) && !*aCancelable) 426 { 427 LogFlowThisFunc(("point-of-no-return reached\n")); 428 mCancelable = FALSE; 429 } 430 } 431 } 432 return hrc; 433 } 434 415 435 STDMETHODIMP ProgressProxy::COMGETTER(Percent)(ULONG *aPercent) 416 436 { 417 #if 0418 437 CheckComArgOutPointerValid(aPercent); 419 438 420 439 AutoCaller autoCaller(this); 421 440 HRESULT hrc = autoCaller.rc(); 422 if (SUCCEEDED( rc))441 if (SUCCEEDED(hrc)) 423 442 { 424 443 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 428 447 else 429 448 { 449 /* 450 * Get the overall percent of the other object and adjust it with 451 * the weighting given to the period before proxying started. 452 */ 430 453 ULONG uPct; 431 454 hrc = mptrOtherProgress->COMGETTER(Percent)(&uPct); 432 .... 433 } 434 } 435 return hrc; 436 #else 437 return Progress::COMGETTER(Percent)(aPercent); 438 #endif 455 if (SUCCEEDED(hrc)) 456 { 457 double rdPercent = ((double)uPct / 100 * muOtherProgressWeight + muOtherProgressStartWeight) 458 / m_ulTotalOperationsWeight * 100; 459 *aPercent = RT_MIN((ULONG)rdPercent, 99); /* mptrOtherProgress is cleared when its completed, so we can never return 100%. */ 460 } 461 } 462 } 463 return hrc; 464 } 465 466 STDMETHODIMP ProgressProxy::COMGETTER(TimeRemaining)(LONG *aTimeRemaining) 467 { 468 CheckComArgOutPointerValid(aTimeRemaining); 469 470 AutoCaller autoCaller(this); 471 HRESULT hrc = autoCaller.rc(); 472 if (SUCCEEDED(hrc)) 473 { 474 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 475 476 if (mptrOtherProgress.isNull()) 477 hrc = Progress::COMGETTER(TimeRemaining)(aTimeRemaining); 478 else 479 hrc = mptrOtherProgress->COMGETTER(TimeRemaining)(aTimeRemaining); 480 } 481 return hrc; 439 482 } 440 483 441 484 STDMETHODIMP ProgressProxy::COMGETTER(Completed)(BOOL *aCompleted) 442 485 { 443 /* Not proxied since we EXPECT a hand backcall. */486 /* Not proxied since we EXPECT a normal completion notification call. */ 444 487 return Progress::COMGETTER(Completed)(aCompleted); 445 488 } … … 458 501 if ( SUCCEEDED(hrc) 459 502 && !*aCanceled 460 && !mptrOtherProgress.isNull()) 503 && mptrOtherProgress.isNotNull() 504 && mCancelable) 461 505 { 462 506 hrc = mptrOtherProgress->COMGETTER(Canceled)(aCanceled); 463 507 if (SUCCEEDED(hrc) && *aCanceled) 464 clearOtherProgressObjectInternal(true /*fEarly*/); 508 /* This will not complete the object, only mark it as canceled. */ 509 clearOtherProgressObjectInternal(false /*fEarly*/); 465 510 } 466 511 } … … 470 515 STDMETHODIMP ProgressProxy::COMGETTER(ResultCode)(LONG *aResultCode) 471 516 { 472 /* Not proxied yet since we EXPECT a hand backcall. */517 /* Not proxied since we EXPECT a normal completion notification call. */ 473 518 return Progress::COMGETTER(ResultCode)(aResultCode); 474 519 } … … 476 521 STDMETHODIMP ProgressProxy::COMGETTER(ErrorInfo)(IVirtualBoxErrorInfo **aErrorInfo) 477 522 { 478 /* Not proxied yet since we EXPECT a hand backcall. */523 /* Not proxied since we EXPECT a normal completion notification call. */ 479 524 return Progress::COMGETTER(ErrorInfo)(aErrorInfo); 480 525 } 481 526 527 STDMETHODIMP ProgressProxy::COMGETTER(Operation)(ULONG *aOperation) 528 { 529 CheckComArgOutPointerValid(aOperation); 530 531 AutoCaller autoCaller(this); 532 HRESULT hrc = autoCaller.rc(); 533 if (SUCCEEDED(hrc)) 534 { 535 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 536 if (mptrOtherProgress.isNull()) 537 hrc = Progress::COMGETTER(Operation)(aOperation); 538 else 539 { 540 ULONG uCurOtherOperation; 541 hrc = mptrOtherProgress->COMGETTER(Operation)(&uCurOtherOperation); 542 if (SUCCEEDED(hrc)) 543 *aOperation = uCurOtherOperation + muOtherProgressStartOperation; 544 } 545 } 546 return hrc; 547 } 548 549 STDMETHODIMP ProgressProxy::COMGETTER(OperationDescription)(BSTR *aOperationDescription) 550 { 551 CheckComArgOutPointerValid(aOperationDescription); 552 553 AutoCaller autoCaller(this); 554 HRESULT hrc = autoCaller.rc(); 555 if (SUCCEEDED(hrc)) 556 { 557 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 558 if (mptrOtherProgress.isNull() || !mfMultiOperation) 559 hrc = Progress::COMGETTER(OperationDescription)(aOperationDescription); 560 else 561 hrc = mptrOtherProgress->COMGETTER(OperationDescription)(aOperationDescription); 562 } 563 return hrc; 564 } 565 482 566 STDMETHODIMP ProgressProxy::COMGETTER(OperationPercent)(ULONG *aOperationPercent) 483 567 { 484 /* Not proxied, should be proxied later on. */ 485 return Progress::COMGETTER(OperationPercent)(aOperationPercent); 568 CheckComArgOutPointerValid(aOperationPercent); 569 570 AutoCaller autoCaller(this); 571 HRESULT hrc = autoCaller.rc(); 572 if (SUCCEEDED(hrc)) 573 { 574 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 575 if (mptrOtherProgress.isNull() || !mfMultiOperation) 576 hrc = Progress::COMGETTER(OperationPercent)(aOperationPercent); 577 else 578 hrc = mptrOtherProgress->COMGETTER(OperationPercent)(aOperationPercent); 579 } 580 return hrc; 486 581 } 487 582 … … 512 607 LogFlowThisFunc(("aTimeout=%d\n", aTimeout)); 513 608 514 /* For now we'll always block locally. */ 609 /* No need to wait on the proxied object for these since we'll get the 610 normal completion notifications. */ 515 611 hrc = Progress::WaitForCompletion(aTimeout); 516 612 … … 521 617 STDMETHODIMP ProgressProxy::WaitForOperationCompletion(ULONG aOperation, LONG aTimeout) 522 618 { 523 HRESULT hrc;524 619 LogFlowThisFuncEnter(); 525 620 LogFlowThisFunc(("aOperation=%d aTimeout=%d\n", aOperation, aTimeout)); 526 621 527 /* For now we'll always block locally. Later though, we could consider 528 blocking remotely when we can. */ 529 hrc = Progress::WaitForOperationCompletion(aOperation, aTimeout); 622 AutoCaller autoCaller(this); 623 HRESULT hrc = autoCaller.rc(); 624 if (SUCCEEDED(hrc)) 625 { 626 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 627 628 CheckComArgExpr(aOperation, aOperation < m_cOperations); 629 630 /* 631 * Check if we can wait locally. 632 */ 633 if ( aOperation + 1 == m_cOperations /* final operation */ 634 || mptrOtherProgress.isNull()) 635 { 636 /* ASSUMES that Progress::WaitForOperationCompletion is using 637 AutoWriteLock::leave() as it saves us from duplicating the code! */ 638 hrc = Progress::WaitForOperationCompletion(aOperation, aTimeout); 639 } 640 else 641 { 642 LogFlowThisFunc(("calling the other object...\n")); 643 ComPtr<IProgress> ptrOtherProgress = mptrOtherProgress; 644 alock.release(); 645 646 hrc = ptrOtherProgress->WaitForOperationCompletion(aOperation, aTimeout); 647 } 648 } 530 649 531 650 LogFlowThisFuncLeave(); … … 541 660 { 542 661 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 543 if (mCancelable) 544 { 545 if (!mptrOtherProgress.isNull()) 546 { 547 hrc = mptrOtherProgress->Cancel(); 548 if (SUCCEEDED(hrc)) 549 { 550 if (m_pfnCancelCallback) 551 m_pfnCancelCallback(m_pvCancelUserArg); 552 clearOtherProgressObjectInternal(true /*fEarly*/); 553 } 554 } 555 else 556 hrc = Progress::Cancel(); 557 } 558 else 559 hrc = setError(E_FAIL, tr("Operation cannot be canceled")); 662 if (mptrOtherProgress.isNull() || !mCancelable) 663 hrc = Progress::Cancel(); 664 else 665 { 666 hrc = mptrOtherProgress->Cancel(); 667 if (SUCCEEDED(hrc)) 668 clearOtherProgressObjectInternal(false /*fEarly*/); 669 } 560 670 } 561 671 -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r29934 r29937 1995 1995 E_INVALIDARG); 1996 1996 1997 /* get the teleporter enable state for the progress object init. */ 1998 BOOL fTeleporterEnabled; 1999 rc = machine->COMGETTER(TeleporterEnabled)(&fTeleporterEnabled); 2000 if (FAILED(rc)) 2001 return rc; 2002 1997 2003 /* create a progress object */ 1998 2004 ComObjPtr<ProgressProxy> progress; 1999 2005 progress.createObject(); 2000 2006 rc = progress->init(this, 2001 static_cast 2007 static_cast<IMachine *>(machine), 2002 2008 Bstr(tr("Spawning session")), 2003 2009 TRUE /* aCancelable */, 2004 1 /* cOtherProgressObjects */, 2005 10 /* uTotalOperationsWeight */, 2010 fTeleporterEnabled ? 20 : 10 /* uTotalOperationsWeight */, 2006 2011 Bstr(tr("Spawning session")), 2007 3/* uFirstOperationWeight */,2008 NULL /* pId*/);2012 2 /* uFirstOperationWeight */, 2013 fTeleporterEnabled ? 3 : 1 /* cOtherProgressObjectOperations */); 2009 2014 if (SUCCEEDED(rc)) 2010 2015 { … … 4521 4526 ComPtr<IVirtualBoxCallback> cbI; 4522 4527 ComPtr<IDispatch> cbD; 4523 4528 4524 4529 cbI = sp; 4525 4530 cbD = sp; 4526 4531 4527 4532 /** 4528 * Would be like this in ideal world, unfortunately our consumers want to be invoked via IDispatch, 4533 * Would be like this in ideal world, unfortunately our consumers want to be invoked via IDispatch, 4529 4534 * thus going the hard way. 4530 4535 */ 4531 #if 0 4536 #if 0 4532 4537 if (cbI != NULL) 4533 { 4538 { 4534 4539 HRESULT hrc = handleCallback(cbI); 4535 4540 if (hrc == VBOX_E_DONT_CALL_AGAIN) … … 4544 4549 4545 4550 ::VariantClear(&varResult); 4546 ::VariantClear(&arg1); 4551 ::VariantClear(&arg1); 4547 4552 ::VariantClear(&arg2); 4548 4553 4549 4554 VARIANTARG args[] = {arg1, arg2}; 4550 4555 DISPPARAMS disp = { args, NULL, sizeof(args)/sizeof(args[0]), 0}; 4551 4556 4552 4557 cbD->Invoke(dispid, IID_NULL, 4553 LOCALE_USER_DEFAULT, 4554 DISPATCH_METHOD, 4555 &disp, &varResult, 4558 LOCALE_USER_DEFAULT, 4559 DISPATCH_METHOD, 4560 &disp, &varResult, 4556 4561 NULL, NULL); 4557 4562 } -
trunk/src/VBox/Main/include/ProgressProxyImpl.h
r29934 r29937 59 59 CBSTR bstrDescription, 60 60 BOOL fCancelable, 61 ULONG cOtherProgressObjects,62 61 ULONG uTotalOperationsWeight, 63 62 CBSTR bstrFirstOperationDescription, 64 63 ULONG uFirstOperationWeight, 65 OUT_GUID pId = NULL);64 ULONG cOtherProgressObjectOperations); 66 65 void uninit(); 67 66 68 67 // IProgress properties 68 STDMETHOD(COMGETTER(Cancelable))(BOOL *aCancelable); 69 69 STDMETHOD(COMGETTER(Percent))(ULONG *aPercent); 70 STDMETHOD(COMGETTER(TimeRemaining))(LONG *aTimeRemaining); 70 71 STDMETHOD(COMGETTER(Completed))(BOOL *aCompleted); 71 72 STDMETHOD(COMGETTER(Canceled))(BOOL *aCanceled); 72 73 STDMETHOD(COMGETTER(ResultCode))(LONG *aResultCode); 73 74 STDMETHOD(COMGETTER(ErrorInfo))(IVirtualBoxErrorInfo **aErrorInfo); 75 //STDMETHOD(COMGETTER(OperationCount))(ULONG *aOperationCount); - not necessary 76 STDMETHOD(COMGETTER(Operation))(ULONG *aOperation); 77 STDMETHOD(COMGETTER(OperationDescription))(BSTR *aOperationDescription); 74 78 STDMETHOD(COMGETTER(OperationPercent))(ULONG *aOperationPercent); 75 79 STDMETHOD(COMSETTER(Timeout))(ULONG aTimeout); … … 85 89 // public methods only for internal purposes 86 90 87 HRESULT setResultCode(HRESULT aResultCode);88 91 HRESULT notifyComplete(HRESULT aResultCode); 89 92 HRESULT notifyComplete(HRESULT aResultCode, … … 91 94 const Bstr &aComponent, 92 95 const char *aText, ...); 93 bool notifyPointOfNoReturn(void); 94 bool setOtherProgressObject(IProgress *pOtherProgress, ULONG uOperationWeight); 95 bool clearOtherProgressObject(const char *pszLastOperationDescription, ULONG uLastOperationWeight); 96 bool setOtherProgressObject(IProgress *pOtherProgress); 96 97 97 98 /** For com::SupportErrorInfoImpl. */ … … 105 106 /** The other progress object. This can be NULL. */ 106 107 ComPtr<IProgress> mptrOtherProgress; 107 /** The number of other progress objects expected. */ 108 ULONG mcOtherProgressObjects; 109 /** The current other progress object. */ 110 ULONG miCurOtherProgressObject; 108 /** Set if the other progress object has multiple operations. */ 109 bool mfMultiOperation; 110 /** The weight the other progress object started at. */ 111 ULONG muOtherProgressStartWeight; 112 /** The weight of other progress object. */ 113 ULONG muOtherProgressWeight; 114 /** The operation number the other progress object started at. */ 115 ULONG muOtherProgressStartOperation; 111 116 112 117 };
Note:
See TracChangeset
for help on using the changeset viewer.