VirtualBox

Changeset 51687 in vbox


Ignore:
Timestamp:
Jun 23, 2014 11:23:59 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94466
Message:

Main/Guid+Progress: big cleanup of Guid.h and some Progress cleanup, mostly removing the totally unused aId parameter of the init method and by deleting long gone initi/uninit methods

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/Guid.h

    r48934 r51687  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3636#endif
    3737
    38 #if defined(VBOX_WITH_XPCOM)
    39 # include <nsMemory.h>
    40 #endif
    41 
    4238#include "VBox/com/string.h"
    4339
     
    4844{
    4945
    50 typedef enum
    51     {
    52         ZERO_GUID,
    53         NORMAL_GUID,
    54         INVALID_GUID
    55     }GuidState_t;
     46typedef enum GuidState_t
     47{
     48    GUID_ZERO,
     49    GUID_NORMAL,
     50    GUID_INVALID
     51} GuidState_t;
    5652
    5753/**
     
    6662    {
    6763        ::RTUuidClear(&mUuid);
    68         refresh();
    69         mGuidState = ZERO_GUID;
     64        mGuidState = GUID_ZERO;
     65        dbg_refresh();
    7066    }
    7167
     
    7369    {
    7470        mUuid = that.mUuid;
    75         refresh();
    76         if (isEmpty())
    77             mGuidState = ZERO_GUID;
    78         else
    79             mGuidState = NORMAL_GUID;
     71        mGuidState = that.mGuidState;
     72        dbg_refresh();
    8073    }
    8174
    8275    Guid(const RTUUID &that)
    8376    {
     77        mGuidState = GUID_NORMAL;
    8478        mUuid = that;
    85         refresh();
    86         if (isEmpty())
    87             mGuidState = ZERO_GUID;
    88         else
    89             mGuidState = NORMAL_GUID;
     79        if (isZero())
     80            mGuidState = GUID_ZERO;
     81        dbg_refresh();
    9082    }
    9183
     
    9486        AssertCompileSize(GUID, sizeof(RTUUID));
    9587        ::memcpy(&mUuid, &that, sizeof(GUID));
    96         refresh();
    97         if (isEmpty())
    98             mGuidState = ZERO_GUID;
     88        mGuidState = GUID_NORMAL;
     89        if (isZero())
     90            mGuidState = GUID_ZERO;
     91        dbg_refresh();
     92    }
     93
     94    /**
     95     * Construct a GUID from a string.
     96     *
     97     * @param   that        The UUID string. Can be with or without the curly
     98     *                      brackets. Empty strings are translated to a zero
     99     *                      GUID, and strings which are not confirming to
     100     *                      valid GUID string representations are marked as
     101     *                      invalid.
     102     */
     103    Guid(const char *that)
     104    {
     105        if (!that || !*that)
     106        {
     107            ::RTUuidClear(&mUuid);
     108            mGuidState = GUID_ZERO;
     109        }
    99110        else
    100             mGuidState = NORMAL_GUID;
    101     }
    102 
    103     /**
    104      * Construct a GUID from a string.
    105      *
    106      * Should the string be invalid, the object will be set to the null GUID
    107      * (isEmpty() == true).
    108      *
    109      * @param   that        The UUID string.  We feed this to RTUuidFromStr(),
    110      *                      so check it out for the exact format.
    111      */
    112     Guid(const char *that)
    113     {
    114         mGuidState = NORMAL_GUID;
    115 
    116         int rc = ::RTUuidFromStr(&mUuid, that);
    117 
    118         if (RT_FAILURE(rc))
    119         {
    120             ::RTUuidClear(&mUuid);
    121             mGuidState = INVALID_GUID;
    122         }
    123         else if(isEmpty())
    124             mGuidState = ZERO_GUID;
    125         refresh();
    126     }
    127 
    128     /**
    129      * Construct a GUID from a BSTR.
    130      *
    131      * Should the string be empty or invalid, the object will be set to the
    132      * null GUID (isEmpty() == true).
    133      *
    134      * @param   that        The UUID BSTR.  We feed this to RTUuidFromUtf16(),
    135      *                      so check it out for the exact format.
    136      */
    137     Guid(const Bstr &that)
    138     {
    139         mGuidState = NORMAL_GUID;
    140 
    141         if (that.isEmpty())
    142         {
    143             ::RTUuidClear(&mUuid);
    144             mGuidState = ZERO_GUID;
    145         }
    146         else
    147         {
    148             int rc = ::RTUuidFromUtf16(&mUuid, that.raw());
     111        {
     112            mGuidState = GUID_NORMAL;
     113            int rc = ::RTUuidFromStr(&mUuid, that);
    149114            if (RT_FAILURE(rc))
    150115            {
    151116                ::RTUuidClear(&mUuid);
    152                 mGuidState = INVALID_GUID;
     117                mGuidState = GUID_INVALID;
    153118            }
    154         }
    155 
    156         refresh();
     119            else if (isZero())
     120                mGuidState = GUID_ZERO;
     121        }
     122        dbg_refresh();
     123    }
     124
     125    /**
     126     * Construct a GUID from a BSTR.
     127     *
     128     * @param   that        The UUID BSTR. Can be with or without the curly
     129     *                      brackets. Empty strings are translated to a zero
     130     *                      GUID, and strings which are not confirming to
     131     *                      valid GUID string representations are marked as
     132     *                      invalid.
     133     */
     134    Guid(CBSTR that)
     135    {
     136        if (!that || !*that)
     137        {
     138            ::RTUuidClear(&mUuid);
     139            mGuidState = GUID_ZERO;
     140        }
     141        else
     142        {
     143            mGuidState = GUID_NORMAL;
     144            int rc = ::RTUuidFromUtf16(&mUuid, that);
     145            if (RT_FAILURE(rc))
     146            {
     147                ::RTUuidClear(&mUuid);
     148                mGuidState = GUID_INVALID;
     149            }
     150            else if (isZero())
     151                mGuidState = GUID_ZERO;
     152        }
     153        dbg_refresh();
     154    }
     155
     156    /**
     157     * Construct a GUID from a Utf8Str.
     158     *
     159     * @param   that        The UUID Utf8Str. Can be with or without the curly
     160     *                      brackets. Empty strings are translated to a zero
     161     *                      GUID, and strings which are not confirming to
     162     *                      valid GUID string representations are marked as
     163     */
     164    Guid(const Utf8Str &that)
     165    {
     166        Guid(that.c_str());
     167    }
     168
     169    /**
     170     * Construct a GUID from a RTCString.
     171     *
     172     * @param   that        The UUID RTCString. Can be with or without the curly
     173     *                      brackets. Empty strings are translated to a zero
     174     *                      GUID, and strings which are not confirming to
     175     *                      valid GUID string representations are marked as
     176     */
     177    Guid(const RTCString &that)
     178    {
     179        Guid(that.c_str());
     180    }
     181
     182    /**
     183     * Construct a GUID from a Bstr.
     184     *
     185     * @param   that        The UUID Bstr. Can be with or without the curly
     186     *                      brackets. Empty strings are translated to a zero
     187     *                      GUID, and strings which are not confirming to
     188     *                      valid GUID string representations are marked as
     189     */
     190    Guid(const Bstr &that)
     191    {
     192        Guid(that.raw());
    157193    }
    158194
    159195    Guid& operator=(const Guid &that)
    160196    {
    161         mGuidState = NORMAL_GUID;
    162         ::memcpy(&mUuid, &that.mUuid, sizeof (RTUUID));
    163         if (isEmpty())
    164             mGuidState = ZERO_GUID;
    165         refresh();
     197        mUuid = that.mUuid;
     198        mGuidState = that.mGuidState;
     199        dbg_refresh();
    166200        return *this;
    167201    }
     202
     203    Guid& operator=(const RTUUID &guid)
     204    {
     205        mUuid = guid;
     206        mGuidState = GUID_NORMAL;
     207        if (isZero())
     208            mGuidState = GUID_ZERO;
     209        dbg_refresh();
     210        return *this;
     211    }
     212
    168213    Guid& operator=(const GUID &guid)
    169214    {
    170         mGuidState = NORMAL_GUID;
    171         ::memcpy(&mUuid, &guid, sizeof (GUID));
    172         if (isEmpty())
    173             mGuidState = ZERO_GUID;
    174         refresh();
     215        AssertCompileSize(GUID, sizeof(RTUUID));
     216        ::memcpy(&mUuid, &guid, sizeof(GUID));
     217        mGuidState = GUID_NORMAL;
     218        if (isZero())
     219            mGuidState = GUID_ZERO;
     220        dbg_refresh();
    175221        return *this;
    176222    }
    177     Guid& operator=(const RTUUID &guid)
    178     {
    179         mGuidState = NORMAL_GUID;
    180         ::memcpy(&mUuid, &guid, sizeof (RTUUID));
    181         if (isEmpty())
    182             mGuidState = ZERO_GUID;
    183         refresh();
     223
     224    Guid& operator=(const char *str)
     225    {
     226        if (!str || !*str)
     227        {
     228            ::RTUuidClear(&mUuid);
     229            mGuidState = GUID_ZERO;
     230        }
     231        else
     232        {
     233            mGuidState = GUID_NORMAL;
     234            int rc = ::RTUuidFromStr(&mUuid, str);
     235            if (RT_FAILURE(rc))
     236            {
     237                ::RTUuidClear(&mUuid);
     238                mGuidState = GUID_INVALID;
     239            }
     240            else if (isZero())
     241                mGuidState = GUID_ZERO;
     242        }
     243        dbg_refresh();
    184244        return *this;
    185245    }
    186     Guid& operator=(const char *str)
    187     {
    188         mGuidState = NORMAL_GUID;
    189         int rc = ::RTUuidFromStr(&mUuid, str);
    190 
    191         if (RT_FAILURE(rc))
     246
     247    Guid& operator=(CBSTR str)
     248    {
     249        if (!str || !*str)
    192250        {
    193251            ::RTUuidClear(&mUuid);
    194             mGuidState = INVALID_GUID;
     252            mGuidState = GUID_ZERO;
    195253        }
    196254        else
    197255        {
    198             if (isEmpty())
    199             mGuidState = ZERO_GUID;
    200         }
    201 
    202         refresh();
    203 
     256            mGuidState = GUID_NORMAL;
     257            int rc = ::RTUuidFromUtf16(&mUuid, str);
     258            if (RT_FAILURE(rc))
     259            {
     260                ::RTUuidClear(&mUuid);
     261                mGuidState = GUID_INVALID;
     262            }
     263            else if (isZero())
     264                mGuidState = GUID_ZERO;
     265        }
     266        dbg_refresh();
    204267        return *this;
    205268    }
    206269
     270    Guid& operator=(const Utf8Str &str)
     271    {
     272        return operator=(str.c_str());
     273    }
     274
     275    Guid& operator=(const RTCString &str)
     276    {
     277        return operator=(str.c_str());
     278    }
     279
     280    Guid& operator=(const Bstr &str)
     281    {
     282        return operator=(str.raw());
     283    }
     284
    207285    void create()
    208286    {
    209287        ::RTUuidCreate(&mUuid);
    210         mGuidState = NORMAL_GUID;
    211         refresh();
    212     }
     288        mGuidState = GUID_NORMAL;
     289        dbg_refresh();
     290    }
     291
    213292    void clear()
    214293    {
    215294        ::RTUuidClear(&mUuid);
    216         mGuidState = ZERO_GUID;
    217         refresh();
     295        mGuidState = GUID_ZERO;
     296        dbg_refresh();
    218297    }
    219298
     
    226305    Utf8Str toString() const
    227306    {
    228         char buf[RTUUID_STR_LENGTH];
    229 
    230         ::memset(buf,0,RTUUID_STR_LENGTH);
    231 
    232         if (mGuidState == INVALID_GUID)
     307        if (mGuidState == GUID_INVALID)
    233308        {
    234309            /* What to return in case of wrong Guid */
     
    236311        }
    237312
    238         ::RTUuidToStr(&mUuid, buf, RTUUID_STR_LENGTH);
    239 
     313        char buf[RTUUID_STR_LENGTH];
     314        ::memset(buf, '\0', sizeof(buf));
     315        ::RTUuidToStr(&mUuid, buf, sizeof(buf));
    240316
    241317        return Utf8Str(buf);
     
    250326    Utf8Str toStringCurly() const
    251327    {
    252 
    253         if (mGuidState == INVALID_GUID)
     328        if (mGuidState == GUID_INVALID)
    254329        {
    255330            /* What to return in case of wrong Guid */
     
    257332        }
    258333
    259         char buf[RTUUID_STR_LENGTH + 2] = "{";
    260 
    261         ::RTUuidToStr(&mUuid, buf + 1, RTUUID_STR_LENGTH);
     334        char buf[RTUUID_STR_LENGTH + 2];
     335        ::memset(buf, '\0', sizeof(buf));
     336        ::RTUuidToStr(&mUuid, buf + 1, sizeof(buf) - 2);
     337        buf[0] = '{';
    262338        buf[sizeof(buf) - 2] = '}';
    263         buf[sizeof(buf) - 1] = '\0';
    264339
    265340        return Utf8Str(buf);
     
    274349    Bstr toUtf16() const
    275350    {
    276         if (mGuidState == INVALID_GUID)
     351        if (mGuidState == GUID_INVALID)
     352        {
     353            /* What to return in case of wrong Guid */
    277354          return Bstr("00000000-0000-0000-0000-00000000000");
     355        }
    278356
    279357        RTUTF16 buf[RTUUID_STR_LENGTH];
    280         ::RTUuidToUtf16(&mUuid, buf, RTUUID_STR_LENGTH);
     358        ::memset(buf, '\0', sizeof(buf));
     359        ::RTUuidToUtf16(&mUuid, buf, RT_ELEMENTS(buf));
     360
    281361        return Bstr(buf);
    282362    }
     
    284364    bool isValid() const
    285365    {
    286         bool res = true;
    287         if (mGuidState == INVALID_GUID)
    288             res = false;
    289 
    290         return res;
     366        return mGuidState != GUID_INVALID;
    291367    }
    292368
    293369    bool isZero() const
    294370    {
    295         return (::RTUuidIsNull(&mUuid) && mGuidState == ZERO_GUID);
     371        return mGuidState == GUID_ZERO;
    296372    }
    297373
    298374    bool operator==(const Guid &that) const { return ::RTUuidCompare(&mUuid, &that.mUuid)    == 0; }
     375    bool operator==(const RTUUID &guid) const { return ::RTUuidCompare(&mUuid, &guid) == 0; }
    299376    bool operator==(const GUID &guid) const { return ::RTUuidCompare(&mUuid, (PRTUUID)&guid) == 0; }
    300377    bool operator!=(const Guid &that) const { return !operator==(that); }
    301378    bool operator!=(const GUID &guid) const { return !operator==(guid); }
    302     bool operator<( const Guid &that) const { return ::RTUuidCompare(&mUuid, &that.mUuid)    < 0; }
    303     bool operator<( const GUID &guid) const { return ::RTUuidCompare(&mUuid, (PRTUUID)&guid) < 0; }
     379    bool operator!=(const RTUUID &guid) const { return !operator==(guid); }
     380    bool operator<(const Guid &that) const { return ::RTUuidCompare(&mUuid, &that.mUuid)    < 0; }
     381    bool operator<(const GUID &guid) const { return ::RTUuidCompare(&mUuid, (PRTUUID)&guid) < 0; }
     382    bool operator<(const RTUUID &guid) const { return ::RTUuidCompare(&mUuid, &guid) < 0; }
    304383
    305384    /**
     
    319398    }
    320399
    321 #if !defined(VBOX_WITH_XPCOM)
    322 
    323     /** To assign instances to OUT_GUID parameters from within the interface
    324      * method. */
    325     const Guid &cloneTo(GUID *pguid) const
    326     {
    327         if (pguid)
    328             ::memcpy(pguid, &mUuid, sizeof(GUID));
    329         return *this;
    330     }
    331 
    332     /** To pass instances as OUT_GUID parameters to interface methods. */
    333     GUID *asOutParam()
    334     {
    335         return (GUID *)&mUuid;
    336     }
    337 
    338 #else
    339 
    340     /** To assign instances to OUT_GUID parameters from within the
    341      * interface method */
    342     const Guid &cloneTo(nsID **ppGuid) const
    343     {
    344         if (ppGuid)
    345             *ppGuid = (nsID *)nsMemory::Clone(&mUuid, sizeof(nsID));
    346 
    347         return *this;
    348     }
    349 
    350     /**
    351      * Internal helper class for asOutParam().
    352      *
    353      * This takes a GUID refrence in the constructor and copies the mUuid from
    354      * the method to that instance in its destructor.
    355      */
    356     class GuidOutParam
    357     {
    358         GuidOutParam(Guid &guid)
    359             : ptr(0),
    360               outer(guid)
    361         {
    362             outer.clear();
    363         }
    364 
    365         nsID *ptr;
    366         Guid &outer;
    367         GuidOutParam(const GuidOutParam &that); // disabled
    368         GuidOutParam &operator=(const GuidOutParam &that); // disabled
    369     public:
    370         operator nsID**() { return &ptr; }
    371         ~GuidOutParam()
    372         {
    373             if (ptr && outer.isEmpty())
    374             {
    375                 outer = *ptr;
    376                 outer.refresh();
    377                 nsMemory::Free(ptr);
    378             }
    379         }
    380         friend class Guid;
    381     };
    382 
    383     /** to pass instances as OUT_GUID parameters to interface methods */
    384     GuidOutParam asOutParam() { return GuidOutParam(*this); }
    385 
    386 #endif
    387 
    388     /* to directly test IN_GUID interface method's parameters */
    389     static bool isEmpty(const GUID &guid)
    390     {
    391         return ::RTUuidIsNull((PRTUUID)&guid);
    392     }
    393 
    394     /**
    395      *  Static immutable empty object. May be used for comparison purposes.
     400    /**
     401     *  Static immutable empty (zero) object. May be used for comparison purposes.
    396402     */
    397403    static const Guid Empty;
    398 
    399 protected:
    400 
    401     bool isEmpty() const
    402     {
    403         return ::RTUuidIsNull(&mUuid);
    404     }
    405 
    406     bool isNotEmpty() const
    407     {
    408         return !::RTUuidIsNull(&mUuid);
    409     }
    410404
    411405private:
     
    417411     * in release code.
    418412     */
    419     inline void refresh()
     413    inline void dbg_refresh()
    420414    {
    421415#ifdef DEBUG
    422 //        ::RTUuidToStr(&mUuid, mszUuid, RTUUID_STR_LENGTH);
    423 //        m_pcszUUID = mszUuid;
     416        switch (mGuidState)
     417        {
     418            case GUID_ZERO:
     419            case GUID_NORMAL:
     420                ::RTUuidToStr(&mUuid, mszUuid, RTUUID_STR_LENGTH);
     421                break;
     422            default:
     423                ::memset(mszUuid, '\0', sizeof(mszUuid));
     424                ::RTStrCopy(mszUuid, sizeof(mszUuid), "INVALID");
     425                break;
     426        }
     427        m_pcszUUID = mszUuid;
    424428#endif
    425429    }
     
    437441#endif
    438442};
    439 /*
    440 inline Bstr asGuidStr(const Bstr& str)
    441 {
    442    Guid guid(str);
    443    return guid.isEmpty() ? Bstr() : guid.toUtf16();
    444 }
    445 */
    446 //inline bool isValidGuid(const Bstr& str)
    447 //{
    448 //   Guid guid(str);
    449 //   return guid.isValid();
    450 ////   return !guid.isEmpty();
    451 //}
    452443
    453444} /* namespace com */
  • trunk/src/VBox/Main/include/ProgressImpl.h

    r50874 r51687  
    66
    77/*
    8  * Copyright (C) 2006-2013 Oracle Corporation
     8 * Copyright (C) 2006-2014 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9191     * @param aDescription
    9292     * @param aCancelable
    93      * @param aId
    9493     * @return
    9594     */
     
    10099                  IUnknown *aInitiator,
    101100                  Utf8Str aDescription,
    102                   BOOL aCancelable,
    103                   OUT_GUID aId = NULL)
     101                  BOOL aCancelable)
    104102    {
    105103        return init(
     
    113111            1,      // ulTotalOperationsWeight
    114112            aDescription, // aFirstOperationDescription
    115             1,      // ulFirstOperationWeight
    116             aId);
     113            1);     // ulFirstOperationWeight
    117114    }
    118115
     
    126123     * @param cOperations
    127124     * @param bstrFirstOperationDescription
    128      * @param aId
    129125     * @return
    130126     */
     
    136132                  Utf8Str aDescription, BOOL aCancelable,
    137133                  ULONG cOperations,
    138                   Utf8Str aFirstOperationDescription,
    139                   OUT_GUID aId = NULL)
     134                  Utf8Str aFirstOperationDescription)
    140135    {
    141136        return init(
     
    149144            cOperations,      // ulTotalOperationsWeight = cOperations
    150145            aFirstOperationDescription, // aFirstOperationDescription
    151             1,      // ulFirstOperationWeight: weigh them all the same
    152             aId);
     146            1);     // ulFirstOperationWeight: weigh them all the same
    153147    }
    154148
     
    163157                  ULONG ulTotalOperationsWeight,
    164158                  Utf8Str aFirstOperationDescription,
    165                   ULONG ulFirstOperationWeight,
    166                   OUT_GUID aId = NULL);
     159                  ULONG ulFirstOperationWeight);
    167160
    168161    HRESULT init(BOOL aCancelable,
     
    170163                 Utf8Str aOperationDescription);
    171164
    172 //   initializer/uninitializer for internal purposes only
    173     HRESULT init(AutoInitSpan &aAutoInitSpan,
    174 #if !defined (VBOX_COM_INPROC)
    175                VirtualBox *aParent,
    176 #endif
    177                IUnknown *aInitiator,
    178                Utf8Str aDescription, OUT_GUID aId = NULL);
    179     HRESULT init(AutoInitSpan &aAutoInitSpan);
    180     void init(AutoUninitSpan &aAutoUninitSpan);
    181165    void uninit();
    182     void uninit(AutoUninitSpan &aAutoUninitSpan);
    183166
    184167
  • trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp

    r51612 r51687  
    610610                                              static_cast<IExtPackFile *>(this),
    611611                                              bstrDescription.raw(),
    612                                               FALSE /*aCancelable*/,
    613                                               NULL /*aId*/);
     612                                              FALSE /*aCancelable*/);
    614613            }
    615614            if (SUCCEEDED(hrc))
     
    19891988                                          static_cast<IExtPackManager *>(this),
    19901989                                          bstrDescription.raw(),
    1991                                           FALSE /*aCancelable*/,
    1992                                           NULL /*aId*/);
     1990                                          FALSE /*aCancelable*/);
    19931991        }
    19941992        if (SUCCEEDED(hrc))
  • trunk/src/VBox/Main/src-all/ProgressImpl.cpp

    r51441 r51687  
    66
    77/*
    8  * Copyright (C) 2006-2013 Oracle Corporation
     8 * Copyright (C) 2006-2014 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    419419 * ulTotalOperationsWeight = ulFirstOperationWeight = 1.
    420420 *
    421  * @param aParent           See Progress::init().
    422  * @param aInitiator        See Progress::init().
    423  * @param aDescription      See Progress::init().
    424  * @param aCancelable       Flag whether the task maybe canceled.
    425  * @param cOperations       Number of operations within this task (at least 1).
     421 * @param aParent       Parent object (only for server-side Progress objects).
     422 * @param aInitiator    Initiator of the task (for server-side objects. Can be
     423 *                      NULL which means initiator = parent, otherwise must not
     424 *                      be NULL).
     425 * @param aDescription  Overall task description.
     426 * @param aCancelable   Flag whether the task maybe canceled.
     427 * @param cOperations   Number of operations within this task (at least 1).
    426428 * @param ulTotalOperationsWeight Total weight of operations; must be the sum of ulFirstOperationWeight and
    427429 *                          what is later passed with each subsequent setNextOperation() call.
    428430 * @param bstrFirstOperationDescription Description of the first operation.
    429431 * @param ulFirstOperationWeight Weight of first sub-operation.
    430  * @param aId               See Progress::init().
    431432 */
    432433HRESULT Progress::init(
     
    440441                       ULONG ulTotalOperationsWeight,
    441442                       Utf8Str aFirstOperationDescription,
    442                        ULONG ulFirstOperationWeight,
    443                        OUT_GUID aId /* = NULL */)
     443                       ULONG ulFirstOperationWeight)
    444444{
    445445    LogFlowThisFunc(("aDescription=\"%s\", cOperations=%d, ulTotalOperationsWeight=%d, aFirstOperationDescription=\"%s\", ulFirstOperationWeight=%d\n",
     
    477477#if !defined(VBOX_COM_INPROC)
    478478    /* assign (and therefore addref) initiator only if it is not VirtualBox
    479      * (to avoid cycling); otherwise mInitiator will remain null which means
    480  *           * that it is the same as the parent */
     479     * (to avoid cycling); otherwise mInitiator will remain null which means
     480     * that it is the same as the parent */
    481481    if (aInitiator)
    482482    {
     
    490490
    491491    unconst(mId).create();
    492     if (aId)
    493         mId.cloneTo(aId);
    494492
    495493#if !defined(VBOX_COM_INPROC)
    496494    /* add to the global collection of progress operations (note: after
    497      * creating mId) */
     495     * creating mId) */
    498496    mParent->i_addProgress(this);
    499497#endif
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r51630 r51687  
    69246924                                        ulTotalOperationsWeight,
    69256925                                        Bstr(tr("Starting Hard Disk operations")).raw(),
    6926                                         1,
    6927                                         NULL);
     6926                                        1);
    69286927            AssertComRCReturnRC(rc);
    69296928        }
     
    69436942                                        10   /* ulTotalOperationsWeight */,
    69446943                                        Bstr(tr("Teleporting virtual machine")).raw(),
    6945                                         1    /* ulFirstOperationWeight */,
    6946                                         NULL);
     6944                                        1    /* ulFirstOperationWeight */);
    69476945        }
    69486946        else if (fFaultToleranceSyncEnabled)
     
    69546952                                        10   /* ulTotalOperationsWeight */,
    69556953                                        Bstr(tr("Fault Tolerance syncing of remote virtual machine")).raw(),
    6956                                         1    /* ulFirstOperationWeight */,
    6957                                         NULL);
     6954                                        1    /* ulFirstOperationWeight */);
    69586955        }
    69596956
  • trunk/src/VBox/Main/src-server/ProgressProxyImpl.cpp

    r50874 r51687  
    55
    66/*
    7  * Copyright (C) 2010-2011 Oracle Corporation
     7 * Copyright (C) 2010-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    8383                          1 /* ulTotalOperationsWeight */,
    8484                          bstrDescription /* bstrFirstOperationDescription */,
    85                           1 /* ulFirstOperationWeight */,
    86                           NULL /* pId */);
     85                          1 /* ulFirstOperationWeight */);
    8786}
    8887
     
    124123                          uTotalOperationsWeight,
    125124                          bstrFirstOperationDescription,
    126                           uFirstOperationWeight,
    127                           NULL);
     125                          uFirstOperationWeight);
    128126}
    129127
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette