VirtualBox

Changeset 73548 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Aug 7, 2018 3:18:17 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
124185
Message:

ExtPackManager: Added i_queryObjects method for collecting objects from all extension packs. bugref:9152.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp

    r73003 r73548  
    28942894}
    28952895
     2896
     2897/**
     2898 * Queries objects of type @a aObjUuid from all the extension packs.
     2899 *
     2900 * @returns COM status code.
     2901 * @param   aObjUuid        The UUID of the kind of objects we're querying.
     2902 * @param   aObjects        Where to return the objects.
     2903 *
     2904 * @remarks The caller must not hold any locks.
     2905 */
     2906HRESULT ExtPackManager::i_queryObjects(const com::Utf8Str &aObjUuid, std::vector<ComPtr<IUnknown> > &aObjects)
     2907{
     2908    aObjects.clear();
     2909
     2910    AutoCaller autoCaller(this);
     2911    HRESULT hrc = autoCaller.rc();
     2912    if (SUCCEEDED(hrc))
     2913    {
     2914        AutoWriteLock autoLock(this COMMA_LOCKVAL_SRC_POS);
     2915        ComPtr<ExtPackManager> ptrSelfRef = this;
     2916
     2917        for (ExtPackList::iterator it = m->llInstalledExtPacks.begin();
     2918             it != m->llInstalledExtPacks.end();
     2919             /* advancing below */)
     2920        {
     2921            ComPtr<IUnknown> ptrIf;
     2922            HRESULT hrc2 = (*it)->queryObject(aObjUuid, ptrIf);
     2923            if (SUCCEEDED(hrc2))
     2924                aObjects.push_back(ptrIf);
     2925            else if (hrc2 != E_NOINTERFACE)
     2926                hrc = hrc2;
     2927        }
     2928
     2929        if (aObjects.size() > 0)
     2930            hrc = S_OK;
     2931    }
     2932    return hrc;
     2933}
     2934
    28962935#endif /* !VBOX_COM_INPROC */
    28972936
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