Changeset 69002 in vbox
- Timestamp:
- Oct 6, 2017 12:49:53 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
include/VBox/log.h (modified) (2 diffs)
-
src/VBox/Main/idl/VirtualBox.xidl (modified) (4 diffs)
-
src/VBox/Main/include/ProgressImpl.h (modified) (3 diffs)
-
src/VBox/Main/src-all/ProgressImpl.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/log.h
r68485 r69002 570 570 /** Main group, IProgress. */ 571 571 LOG_GROUP_MAIN_PROGRESS, 572 /** Main group, IProgressEvent. */ 573 LOG_GROUP_MAIN_PROGRESSEVENT, 574 /** Main group, IProgressPercentageChangedEvent. */ 575 LOG_GROUP_MAIN_PROGRESSPERCENTAGECHANGEDEVENT, 576 /** Main group, IProgressTaskCompletedEvent. */ 577 LOG_GROUP_MAIN_PROGRESSTASKCOMPLETEDEVENT, 572 578 /** Main group, IReusableEvent. */ 573 579 LOG_GROUP_MAIN_REUSABLEEVENT, … … 1076 1082 "MAIN_PROCESS", \ 1077 1083 "MAIN_PROGRESS", \ 1084 "MAIN_PROGRESSEVENT", \ 1085 "MAIN_PROGRESSPERCENTAGECHANGEDEVENT", \ 1086 "MAIN_PROGRESSTASKCOMPLETEDEVENT", \ 1078 1087 "MAIN_REUSABLEEVENT", \ 1079 1088 "MAIN_RUNTIMEERROREVENT", \ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r68986 r69002 13973 13973 <interface 13974 13974 name="IProgress" extends="$unknown" 13975 uuid=" 77faf1c0-489d-b123-274c-5a95e77ab286"13975 uuid="e0026dc0-0c55-47b1-aa64-d340a396b418" 13976 13976 wsmap="managed" 13977 13977 reservedMethods="1" reservedAttributes="2" … … 14109 14109 </desc> 14110 14110 </attribute> 14111 14112 <attribute name="eventSource" type="IEventSource" readonly="yes"/> 14111 14113 14112 14114 <method name="setCurrentOperationProgress"> … … 22256 22258 </desc> 22257 22259 </const> 22260 <const name="OnProgressPercentageChanged" value="98"> 22261 <desc> 22262 See <link to="IProgressPercentageChangedEvent">IProgressPercentageChangedEvent</link>. 22263 </desc> 22264 </const> 22265 <const name="OnProgressTaskCompleted" value="99"> 22266 <desc> 22267 See <link to="IProgressTaskCompletedEvent">IProgressTaskCompletedEvent</link>. 22268 </desc> 22269 </const> 22258 22270 <!-- Last event marker --> 22259 <const name="Last" value=" 98">22271 <const name="Last" value="100"> 22260 22272 <desc> 22261 22273 Must be last event, used for iterations and structures relying on numerical event values. … … 24299 24311 </interface> 24300 24312 24313 <interface 24314 name="IProgressEvent" extends="IEvent" 24315 uuid="daaf9016-1f04-4191-aa2f-1fac9646ae4c" 24316 wsmap="managed" id="ProgressEvent"> 24317 <desc>Base abstract interface for all progress events.</desc> 24318 24319 <attribute name="progressId" readonly="yes" type="uuid" mod="string"> 24320 <desc>GUID of the progress this event relates to.</desc> 24321 </attribute> 24322 24323 </interface> 24324 24325 <interface 24326 name="IProgressPercentageChangedEvent" extends="IProgressEvent" 24327 uuid="f05d7e60-1bcf-4218-9807-04e036cc70f1" 24328 wsmap="managed" autogen="VBoxEvent" id="OnProgressPercentageChanged"> 24329 <desc>Progress state change event.</desc> 24330 24331 <attribute name="percent" readonly="yes" type="long"> 24332 <desc>New percent</desc> 24333 </attribute> 24334 </interface> 24335 24336 <interface 24337 name="IProgressTaskCompletedEvent" extends="IProgressEvent" 24338 uuid="a5bbdb7d-8ce7-469f-a4c2-6476f581ff72" 24339 wsmap="managed" autogen="VBoxEvent" id="OnProgressTaskCompleted"> 24340 <desc>Progress task completion event.</desc> 24341 <attribute name="midlDoesNotLikeEmptyInterfaces" readonly="yes" type="boolean"/> 24342 </interface> 24343 24301 24344 <module name="VBoxSVC" context="LocalServer"> 24302 24345 <class name="VirtualBox" uuid="B1A7A4F2-47B9-4A1E-82B2-07CCD5323C3F" -
trunk/src/VBox/Main/include/ProgressImpl.h
r67245 r69002 22 22 #include "ProgressWrap.h" 23 23 #include "VirtualBoxBase.h" 24 #include "EventImpl.h" 24 25 25 26 #include <iprt/semaphore.h> … … 151 152 VirtualBox * const mParent; 152 153 #endif 153 154 const ComObjPtr<EventSource> pEventSource; 154 155 const ComPtr<IUnknown> mInitiator; 155 156 … … 203 204 HRESULT getTimeout(ULONG *aTimeout); 204 205 HRESULT setTimeout(ULONG aTimeout); 206 HRESULT getEventSource(ComPtr<IEventSource> &aEventSource); 205 207 206 208 // wrapped IProgress methods -
trunk/src/VBox/Main/src-all/ProgressImpl.cpp
r67242 r69002 42 42 #include "AutoCaller.h" 43 43 44 #include "VBoxEvents.h" 44 45 45 46 Progress::Progress() … … 168 169 169 170 HRESULT rc = S_OK; 171 rc = unconst(pEventSource).createObject(); 172 if (FAILED(rc)) throw rc; 173 174 rc = pEventSource->init(); 175 if (FAILED(rc)) throw rc; 170 176 171 177 // rc = Progress::init( … … 475 481 RTSemEventMultiSignal(mCompletedSem); 476 482 483 fireProgressTaskCompletedEvent(pEventSource, mId.toUtf16().raw()); 484 477 485 return S_OK; 478 486 } … … 563 571 vrc = VERR_CANCELLED; 564 572 } 573 ULONG actualPercent = 0; 574 pThis->getPercent(&actualPercent); 575 fireProgressPercentageChangedEvent(pThis->pEventSource, pThis->mId.toUtf16().raw(), actualPercent); 565 576 } 566 577 /* else ignored */ … … 813 824 m_ulOperationPercent = aPercent; 814 825 826 ULONG actualPercent = 0; 827 getPercent(&actualPercent); 828 fireProgressPercentageChangedEvent(pEventSource, mId.toUtf16().raw(), actualPercent); 829 815 830 return S_OK; 816 831 } … … 847 862 if (mWaitersCount > 0) 848 863 RTSemEventMultiSignal(mCompletedSem); 864 865 ULONG actualPercent = 0; 866 getPercent(&actualPercent); 867 fireProgressPercentageChangedEvent(pEventSource, mId.toUtf16().raw(), actualPercent); 849 868 850 869 return S_OK; … … 1075 1094 } 1076 1095 1096 HRESULT Progress::getEventSource(ComPtr<IEventSource> &aEventSource) 1097 { 1098 /* event source is const, no need to lock */ 1099 pEventSource.queryInterfaceTo(aEventSource.asOutParam()); 1100 return S_OK; 1101 } 1077 1102 1078 1103 // private internal helpers
Note:
See TracChangeset
for help on using the changeset viewer.

