- Timestamp:
- Sep 9, 2020 3:03:23 AM (4 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r86068 r86069 24467 24467 <enum 24468 24468 name="VBoxEventType" 24469 uuid=" d5d15e38-808d-11e9-aaac-4bc5d973ca37"24469 uuid="2ab7c196-f232-11ea-a5d2-83b96bc30bcc" 24470 24470 > 24471 24471 … … 24896 24896 </desc> 24897 24897 </const> 24898 <const name="OnCloudProviderRegistered" value="105"> 24899 <desc> 24900 See <link to="ICloudProviderRegisteredEvent">ICloudProviderRegisteredEvent</link>. 24901 </desc> 24902 </const> 24903 <const name="OnCloudProfileRegistered" value="106"> 24898 <const name="OnCloudProviderListChanged" value="105"> 24899 <desc> 24900 See <link to="ICloudProviderListChangedEvent"/>. 24901 </desc> 24902 </const> 24903 <const name="OnCloudProviderRegistered" value="106"> 24904 <desc> 24905 See <link to="ICloudProviderRegisteredEvent"/>. 24906 </desc> 24907 </const> 24908 <const name="OnCloudProviderUninstall" value="107"> 24909 <desc> 24910 See <link to="ICloudProviderUninstallEvent"/>. 24911 </desc> 24912 </const> 24913 <const name="OnCloudProfileRegistered" value="108"> 24904 24914 <desc> 24905 24915 See <link to="ICloudProfileRegisteredEvent"/>. 24906 24916 </desc> 24907 24917 </const> 24908 <const name="OnCloudProfileChanged" value="10 7">24918 <const name="OnCloudProfileChanged" value="109"> 24909 24919 <desc> 24910 24920 See <!-- link to="ICloudProfileChangedEvent"/--> ICloudProfileChangedEvent. … … 24913 24923 <!-- End event marker --> 24914 24924 <!-- @todo rename to 'End' as it is exclusive (we use 'last' to be inclusive). --> 24915 <const name="Last" value="1 08">24925 <const name="Last" value="110"> 24916 24926 <desc> 24917 24927 Must be last event, used for iterations and structures relying on numerical event values. … … 28253 28263 </interface> 28254 28264 28265 <interface name="ICloudProviderListChangedEvent" extends="IEvent" 28266 uuid="a54d9cca-f23f-11ea-9755-efd0f1f792d9" 28267 wsmap="managed" autogen="VBoxEvent" 28268 id="OnCloudProviderListChanged" 28269 > 28270 <desc> 28271 Each individual provider that is installed or uninstalled is 28272 reported as an <link to="ICloudProviderRegisteredEvent"/>. When 28273 the batch is done this event is sent and listerns can get the 28274 new list. 28275 </desc> 28276 <attribute name="registered" type="boolean" readonly="yes"/> 28277 </interface> 28278 28255 28279 <interface name="ICloudProviderRegisteredEvent" extends="IEvent" 28256 uuid=" 3d515696-eb98-11ea-96ac-8b4794b20214"28280 uuid="e28e227a-f231-11ea-9641-9b500c6d5365" 28257 28281 wsmap="managed" autogen="VBoxEvent" 28258 id="OnCloudProviderRegistered" waitable="yes" 28259 > 28282 id="OnCloudProviderRegistered" 28283 > 28284 <desc> 28285 A cloud provider was installed or uninstalled. 28286 See also <link to="ICloudProviderListChangedEvent"/>. 28287 </desc> 28260 28288 <attribute name="id" type="uuid" mod="string" readonly="yes"/> 28261 28289 <attribute name="registered" type="boolean" readonly="yes"/> 28290 </interface> 28291 28292 <interface name="ICloudProviderUninstallEvent" extends="IEvent" 28293 uuid="f01f1066-f231-11ea-8eee-33bb2afb0b6e" 28294 wsmap="managed" autogen="VBoxEvent" 28295 id="OnCloudProviderCanUninstall" waitable="yes" 28296 > 28297 <desc> 28298 A cloud provider is about to be uninstalled. 28299 Unlike <link to="ICloudProviderRegisteredEvent"/> this one is 28300 waitable and is sent <i>before</i> an attempt is made to 28301 uninstall a provider. Listerns should release references to the 28302 provider and related objects if they have any, or the 28303 uninstallation of the provider is going to fail because it's 28304 still in use. 28305 </desc> 28306 <attribute name="id" type="uuid" mod="string" readonly="yes"/> 28262 28307 </interface> 28263 28308 -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r86012 r86069 209 209 int i_natNetworkRefDec(const Utf8Str &aNetworkName); 210 210 211 void i_onCloudProviderRegistered(const Utf8Str &aId, BOOL aRegistered); 211 void i_onCloudProviderListChanged(BOOL aRegistered); 212 void i_onCloudProviderRegistered(const Utf8Str &aProviderId, BOOL aRegistered); 213 void i_onCloudProviderUninstall(const Utf8Str &aProviderId); 212 214 213 215 #ifdef VBOX_WITH_CLOUD_NET -
trunk/src/VBox/Main/src-server/CloudProviderManagerImpl.cpp
r86013 r86069 136 136 { 137 137 /* do this before the provider goes over the rainbow bridge */ 138 pTmpProvider->COMGETTER(Id)(bstrProviderId.asOutParam()); 139 140 /** 141 * @todo r=uwe We send the event @em before we even 142 * try to uninstall the provider. The GUI can get the 143 * event and get rid of any references to the objects 144 * related to this provider that it still has. The 145 * current uninstall attempt might fail, but the GUI 146 * can then retry once and likely succeed. Needs more 147 * thought and feeback from dsen. 138 hrc = pTmpProvider->COMGETTER(Id)(bstrProviderId.asOutParam()); 139 140 /* 141 * We send this event @em before we try to uninstall 142 * the provider. The GUI can get the event and get 143 * rid of any references to the objects related to 144 * this provider that it still has. 148 145 */ 149 m_pVirtualBox->i_onCloudProviderRegistered(bstrProviderId, FALSE); 146 if (bstrProviderId.isNotEmpty()) 147 m_pVirtualBox->i_onCloudProviderUninstall(bstrProviderId); 150 148 151 149 hrc = pTmpProvider->PrepareUninstall(); … … 159 157 m_astrExtPackNames.erase(m_astrExtPackNames.begin() + (ssize_t)i); 160 158 m_apCloudProviders.erase(m_apCloudProviders.begin() + (ssize_t)i); 159 160 if (bstrProviderId.isNotEmpty()) 161 m_pVirtualBox->i_onCloudProviderRegistered(bstrProviderId, FALSE); 162 161 163 /* NB: not advancing loop index */ 162 164 } … … 172 174 if (fRes) 173 175 m_mapCloudProviderManagers.erase(it); 176 177 /** 178 * Tell listeners we are done and they can re-read the new 179 * list of providers. 180 */ 181 m_pVirtualBox->i_onCloudProviderListChanged(FALSE); 174 182 } 175 183 … … 208 216 m_mapCloudProviderManagers[strExtPackName] = pManager; 209 217 210 /* collect provider ids for bulk-sending the events */211 std::vector<Utf8Str> aProviderIds;212 aProviderIds.reserve(apProvidersFromCurrExtPack.size());213 214 218 for (unsigned i = 0; i < apProvidersFromCurrExtPack.size(); i++) 215 219 { … … 228 232 m_apCloudProviders.push_back(pProvider); 229 233 230 /* note the id of this provider to send an event later */231 234 Bstr bstrProviderId; 232 235 pProvider->COMGETTER(Id)(bstrProviderId.asOutParam()); 233 aProviderIds.push_back(bstrProviderId); 234 } 235 } 236 } 237 238 /* bulk-send ICloudProviderRegisteredEvent's */ 239 for (size_t i = 0; i < aProviderIds.size(); ++i) 240 { 241 m_pVirtualBox->i_onCloudProviderRegistered(aProviderIds[i], TRUE); 242 } 236 if (bstrProviderId.isNotEmpty()) 237 m_pVirtualBox->i_onCloudProviderRegistered(bstrProviderId, TRUE); 238 } 239 } 240 } 241 242 /** 243 * Tell listeners we are done and they can re-read the new list of 244 * providers. 245 */ 246 m_pVirtualBox->i_onCloudProviderListChanged(TRUE); 243 247 } 244 248 -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r86012 r86069 3819 3819 3820 3820 3821 void VirtualBox::i_onCloudProviderRegistered(const Utf8Str &aId, BOOL aRegistered) 3821 void VirtualBox::i_onCloudProviderListChanged(BOOL aRegistered) 3822 { 3823 ::FireCloudProviderListChangedEvent(m->pEventSource, aRegistered); 3824 } 3825 3826 3827 void VirtualBox::i_onCloudProviderRegistered(const Utf8Str &aProviderId, BOOL aRegistered) 3828 { 3829 ::FireCloudProviderRegisteredEvent(m->pEventSource, aProviderId, aRegistered); 3830 } 3831 3832 3833 void VirtualBox::i_onCloudProviderUninstall(const Utf8Str &aProviderId) 3822 3834 { 3823 3835 HRESULT hrc; 3824 3836 3825 3837 ComPtr<IEvent> pEvent; 3826 hrc = CreateCloudProvider RegisteredEvent(pEvent.asOutParam(), m->pEventSource,3827 aId, aRegistered);3838 hrc = CreateCloudProviderUninstallEvent(pEvent.asOutParam(), 3839 m->pEventSource, aProviderId); 3828 3840 if (FAILED(hrc)) 3829 3841 return; 3830 3842 3831 3843 BOOL fDelivered = FALSE; 3832 hrc = m->pEventSource->FireEvent(pEvent, 10000, &fDelivered); // XXX: timeout3844 hrc = m->pEventSource->FireEvent(pEvent, /* :timeout */ 10000, &fDelivered); 3833 3845 if (FAILED(hrc)) 3834 3846 return;
Note:
See TracChangeset
for help on using the changeset viewer.