VirtualBox

Changeset 44407 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jan 28, 2013 9:04:31 AM (12 years ago)
Author:
vboxsync
Message:

Main/VRDEServer: allow settings changes when the VM is saved, plus numerous minor coding style/whitespace fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/VRDEServerImpl.cpp

    r38365 r44407  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7373 *  @param aParent  Handle of the parent object.
    7474 */
    75 HRESULT VRDEServer::init (Machine *aParent)
     75HRESULT VRDEServer::init(Machine *aParent)
    7676{
    7777    LogFlowThisFunc(("aParent=%p\n", aParent));
     
    112112 *  @note Locks @a aThat object for reading.
    113113 */
    114 HRESULT VRDEServer::init (Machine *aParent, VRDEServer *aThat)
     114HRESULT VRDEServer::init(Machine *aParent, VRDEServer *aThat)
    115115{
    116116    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
     
    125125    unconst(mPeer) = aThat;
    126126
    127     AutoCaller thatCaller (aThat);
     127    AutoCaller thatCaller(aThat);
    128128    AssertComRCReturnRC(thatCaller.rc());
    129129
    130130    AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS);
    131     mData.share (aThat->mData);
     131    mData.share(aThat->mData);
    132132
    133133    /* Confirm a successful initialization */
     
    144144 *  @note Locks @a aThat object for reading.
    145145 */
    146 HRESULT VRDEServer::initCopy (Machine *aParent, VRDEServer *aThat)
     146HRESULT VRDEServer::initCopy(Machine *aParent, VRDEServer *aThat)
    147147{
    148148    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
     
    157157    /* mPeer is left null */
    158158
    159     AutoCaller thatCaller (aThat);
     159    AutoCaller thatCaller(aThat);
    160160    AssertComRCReturnRC(thatCaller.rc());
    161161
    162162    AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS);
    163     mData.attachCopy (aThat->mData);
     163    mData.attachCopy(aThat->mData);
    164164
    165165    /* Confirm a successful initialization */
     
    246246/////////////////////////////////////////////////////////////////////////////
    247247
    248 STDMETHODIMP VRDEServer::COMGETTER(Enabled) (BOOL *aEnabled)
     248STDMETHODIMP VRDEServer::COMGETTER(Enabled)(BOOL *aEnabled)
    249249{
    250250    CheckComArgOutPointerValid(aEnabled);
     
    258258}
    259259
    260 STDMETHODIMP VRDEServer::COMSETTER(Enabled) (BOOL aEnabled)
     260STDMETHODIMP VRDEServer::COMSETTER(Enabled)(BOOL aEnabled)
    261261{
    262262    AutoCaller autoCaller(this);
     
    264264
    265265    /* the machine can also be in saved state for this property to change */
    266     AutoMutableOrSavedStateDependency adep (mParent);
     266    AutoMutableOrSavedStateDependency adep(mParent);
    267267    if (FAILED(adep.rc())) return adep.rc();
    268268
     
    374374}
    375375
    376 STDMETHODIMP VRDEServer::SetVRDEProperty (IN_BSTR aKey, IN_BSTR aValue)
     376STDMETHODIMP VRDEServer::SetVRDEProperty(IN_BSTR aKey, IN_BSTR aValue)
    377377{
    378378    LogFlowThisFunc(("\n"));
     
    381381    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    382382
    383     /* The machine needs to be mutable. */
    384     AutoMutableStateDependency adep(mParent);
     383    /* the machine can also be in saved state for this property to change */
     384    AutoMutableOrSavedStateDependency adep(mParent);
    385385    if (FAILED(adep.rc())) return adep.rc();
    386386
     
    461461}
    462462
    463 STDMETHODIMP VRDEServer::GetVRDEProperty (IN_BSTR aKey, BSTR *aValue)
     463STDMETHODIMP VRDEServer::GetVRDEProperty(IN_BSTR aKey, BSTR *aValue)
    464464{
    465465    CheckComArgOutPointerValid(aValue);
     
    628628}
    629629
    630 STDMETHODIMP VRDEServer::COMGETTER(AuthType) (AuthType_T *aType)
     630STDMETHODIMP VRDEServer::COMGETTER(AuthType)(AuthType_T *aType)
    631631{
    632632    CheckComArgOutPointerValid(aType);
     
    642642}
    643643
    644 STDMETHODIMP VRDEServer::COMSETTER(AuthType) (AuthType_T aType)
    645 {
    646     AutoCaller autoCaller(this);
    647     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    648 
    649     /* the machine needs to be mutable */
    650     AutoMutableStateDependency adep(mParent);
     644STDMETHODIMP VRDEServer::COMSETTER(AuthType)(AuthType_T aType)
     645{
     646    AutoCaller autoCaller(this);
     647    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     648
     649    /* the machine can also be in saved state for this property to change */
     650    AutoMutableOrSavedStateDependency adep(mParent);
    651651    if (FAILED(adep.rc())) return adep.rc();
    652652
     
    671671}
    672672
    673 STDMETHODIMP VRDEServer::COMGETTER(AuthTimeout) (ULONG *aTimeout)
     673STDMETHODIMP VRDEServer::COMGETTER(AuthTimeout)(ULONG *aTimeout)
    674674{
    675675    CheckComArgOutPointerValid(aTimeout);
     
    685685}
    686686
    687 STDMETHODIMP VRDEServer::COMSETTER(AuthTimeout) (ULONG aTimeout)
    688 {
    689     AutoCaller autoCaller(this);
    690     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    691 
    692     /* the machine needs to be mutable */
    693     AutoMutableStateDependency adep(mParent);
     687STDMETHODIMP VRDEServer::COMSETTER(AuthTimeout)(ULONG aTimeout)
     688{
     689    AutoCaller autoCaller(this);
     690    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     691
     692    /* the machine can also be in saved state for this property to change */
     693    AutoMutableOrSavedStateDependency adep(mParent);
    694694    if (FAILED(adep.rc())) return adep.rc();
    695695
     
    718718}
    719719
    720 STDMETHODIMP VRDEServer::COMGETTER(AuthLibrary) (BSTR *aLibrary)
     720STDMETHODIMP VRDEServer::COMGETTER(AuthLibrary)(BSTR *aLibrary)
    721721{
    722722    CheckComArgOutPointerValid(aLibrary);
     
    749749}
    750750
    751 STDMETHODIMP VRDEServer::COMSETTER(AuthLibrary) (IN_BSTR aLibrary)
    752 {
    753     AutoCaller autoCaller(this);
    754     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    755 
    756     /* the machine needs to be mutable */
    757     AutoMutableStateDependency adep(mParent);
     751STDMETHODIMP VRDEServer::COMSETTER(AuthLibrary)(IN_BSTR aLibrary)
     752{
     753    AutoCaller autoCaller(this);
     754    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     755
     756    /* the machine can also be in saved state for this property to change */
     757    AutoMutableOrSavedStateDependency adep(mParent);
    758758    if (FAILED(adep.rc())) return adep.rc();
    759759
     
    780780}
    781781
    782 STDMETHODIMP VRDEServer::COMGETTER(AllowMultiConnection) (
    783     BOOL *aAllowMultiConnection)
     782STDMETHODIMP VRDEServer::COMGETTER(AllowMultiConnection)(BOOL *aAllowMultiConnection)
    784783{
    785784    CheckComArgOutPointerValid(aAllowMultiConnection);
     
    795794}
    796795
    797 STDMETHODIMP VRDEServer::COMSETTER(AllowMultiConnection) (
    798     BOOL aAllowMultiConnection)
    799 {
    800     AutoCaller autoCaller(this);
    801     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    802 
    803     /* the machine needs to be mutable */
    804     AutoMutableStateDependency adep(mParent);
     796STDMETHODIMP VRDEServer::COMSETTER(AllowMultiConnection)(BOOL aAllowMultiConnection)
     797{
     798    AutoCaller autoCaller(this);
     799    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     800
     801    /* the machine can also be in saved state for this property to change */
     802    AutoMutableOrSavedStateDependency adep(mParent);
    805803    if (FAILED(adep.rc())) return adep.rc();
    806804
     
    825823}
    826824
    827 STDMETHODIMP VRDEServer::COMGETTER(ReuseSingleConnection) (
    828     BOOL *aReuseSingleConnection)
     825STDMETHODIMP VRDEServer::COMGETTER(ReuseSingleConnection)(BOOL *aReuseSingleConnection)
    829826{
    830827    CheckComArgOutPointerValid(aReuseSingleConnection);
     
    840837}
    841838
    842 STDMETHODIMP VRDEServer::COMSETTER(ReuseSingleConnection) (
    843     BOOL aReuseSingleConnection)
    844 {
    845     AutoCaller autoCaller(this);
    846     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    847 
    848     /* the machine needs to be mutable */
    849     AutoMutableStateDependency adep(mParent);
     839STDMETHODIMP VRDEServer::COMSETTER(ReuseSingleConnection)(BOOL aReuseSingleConnection)
     840{
     841    AutoCaller autoCaller(this);
     842    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     843
     844    /* the machine can also be in saved state for this property to change */
     845    AutoMutableOrSavedStateDependency adep(mParent);
    850846    if (FAILED(adep.rc())) return adep.rc();
    851847
     
    870866}
    871867
    872 STDMETHODIMP VRDEServer::COMGETTER(VRDEExtPack) (BSTR *aExtPack)
     868STDMETHODIMP VRDEServer::COMGETTER(VRDEExtPack)(BSTR *aExtPack)
    873869{
    874870    CheckComArgOutPointerValid(aExtPack);
     
    920916    if (SUCCEEDED(hrc))
    921917    {
    922         /* the machine needs to be mutable */
    923         AutoMutableStateDependency adep(mParent);
     918        /* the machine can also be in saved state for this property to change */
     919        AutoMutableOrSavedStateDependency adep(mParent);
    924920        hrc = adep.rc();
    925921        if (SUCCEEDED(hrc))
     
    995991    /* sanity */
    996992    AutoCaller autoCaller(this);
    997     AssertComRCReturnVoid (autoCaller.rc());
     993    AssertComRCReturnVoid(autoCaller.rc());
    998994
    999995    /* sanity too */
    1000     AutoCaller peerCaller (mPeer);
    1001     AssertComRCReturnVoid (peerCaller.rc());
     996    AutoCaller peerCaller(mPeer);
     997    AssertComRCReturnVoid(peerCaller.rc());
    1002998
    1003999    /* lock both for writing since we modify both (mPeer is "master" so locked
     
    10111007        {
    10121008            /* attach new data to the peer and reshare it */
    1013             mPeer->mData.attach (mData);
     1009            mPeer->mData.attach(mData);
    10141010        }
    10151011    }
     
    10201016 *  represented by @a aThat (locked for reading).
    10211017 */
    1022 void VRDEServer::copyFrom (VRDEServer *aThat)
    1023 {
    1024     AssertReturnVoid (aThat != NULL);
     1018void VRDEServer::copyFrom(VRDEServer *aThat)
     1019{
     1020    AssertReturnVoid(aThat != NULL);
    10251021
    10261022    /* sanity */
    10271023    AutoCaller autoCaller(this);
    1028     AssertComRCReturnVoid (autoCaller.rc());
     1024    AssertComRCReturnVoid(autoCaller.rc());
    10291025
    10301026    /* sanity too */
    1031     AutoCaller thatCaller (aThat);
    1032     AssertComRCReturnVoid (thatCaller.rc());
     1027    AutoCaller thatCaller(aThat);
     1028    AssertComRCReturnVoid(thatCaller.rc());
    10331029
    10341030    /* peer is not modified, lock it for reading (aThat is "master" so locked
     
    10381034
    10391035    /* this will back up current data */
    1040     mData.assignCopy (aThat->mData);
     1036    mData.assignCopy(aThat->mData);
    10411037}
    10421038/* vi: set tabstop=4 shiftwidth=4 expandtab: */
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