VirtualBox

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


Ignore:
Timestamp:
Jun 27, 2013 7:58:37 AM (11 years ago)
Author:
vboxsync
Message:

Main: do not include VirtualBoxImpl.h from code ending in VBoxC (causes unnecessary rebuilds), and make sure that the code still builds with VBOX_WITH_RESOURCE_USAGE_API unset

Location:
trunk/src/VBox/Main
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h

    r43538 r46820  
    77
    88/*
    9  * Copyright (C) 2006-2012 Oracle Corporation
     9 * Copyright (C) 2006-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7979
    8080    HRESULT setVirtualBox(VirtualBox *pVBox);
     81#ifdef VBOX_WITH_RESOURCE_USAGE_API
    8182    void registerMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr);
    8283    void unregisterMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr);
     84#endif
    8385
    8486private:
  • trunk/src/VBox/Main/include/SharedFolderImpl.h

    r44528 r46820  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    100100
    101101    /* weak parents (only one of them is not null) */
     102#if !defined(VBOX_COM_INPROC)
    102103    Machine * const         mMachine;
     104    VirtualBox * const      mVirtualBox;
     105#else
    103106    Console * const         mConsole;
    104     VirtualBox * const      mVirtualBox;
     107#endif
    105108
    106109    struct Data;            // opaque data struct, defined in SharedFolderImpl.cpp
  • trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp

    r44529 r46820  
    4646#include "ProgressImpl.h"
    4747#include "SystemPropertiesImpl.h"
     48#if !defined(VBOX_COM_INPROC)
    4849#include "VirtualBoxImpl.h"
     50#endif
    4951
    5052
     
    8183};
    8284
     85#if !defined(VBOX_COM_INPROC)
    8386/**
    8487 * Private extension pack data.
     
    102105    RTMEMEF_NEW_AND_DELETE_OPERATORS();
    103106};
     107#endif
    104108
    105109/**
     
    151155    /** The list of installed extension packs. */
    152156    ExtPackList         llInstalledExtPacks;
     157#if !defined(VBOX_COM_INPROC)
    153158    /** Pointer to the VirtualBox object, our parent. */
    154159    VirtualBox         *pVirtualBox;
     160#endif
    155161    /** The current context. */
    156162    VBOXEXTPACKCTX      enmContext;
     
    163169};
    164170
     171#if !defined(VBOX_COM_INPROC)
    165172/**
    166173 * Extension pack installation job.
     
    706713}
    707714
     715#endif
    708716
    709717
     
    18841892    m->strBaseDir           = szBaseDir;
    18851893    m->strCertificatDirPath = szCertificatDir;
     1894#if !defined(VBOX_COM_INPROC)
    18861895    m->pVirtualBox          = a_pVirtualBox;
     1896#endif
    18871897    m->enmContext           = a_enmContext;
    18881898
     
    20292039}
    20302040
     2041#if !defined(VBOX_COM_INPROC)
    20312042STDMETHODIMP ExtPackManager::OpenExtPackFile(IN_BSTR a_bstrTarballAndDigest, IExtPackFile **a_ppExtPackFile)
    20322043{
     
    21172128    return hrc;
    21182129}
     2130#endif
    21192131
    21202132STDMETHODIMP ExtPackManager::Cleanup(void)
     
    24492461}
    24502462
     2463#if !defined(VBOX_COM_INPROC)
    24512464/**
    24522465 * Refreshes the specified extension pack.
     
    28492862    }
    28502863}
     2864#endif
    28512865
    28522866/**
     
    28762890}
    28772891
     2892#if !defined(VBOX_COM_INPROC)
    28782893/**
    28792894 * Calls the pfnVMCreated hook for all working extension packs.
     
    28942909        (*it)->callVmCreatedHook(m->pVirtualBox, a_pMachine, &autoLock);
    28952910}
     2911#endif
    28962912
    28972913/**
  • trunk/src/VBox/Main/src-all/ProgressImpl.cpp

    r45367 r46820  
    2828#include "ProgressImpl.h"
    2929
    30 #include "VirtualBoxImpl.h"
     30#if !defined(VBOX_COM_INPROC)
     31# include "VirtualBoxImpl.h"
     32#endif
    3133#include "VirtualBoxErrorInfoImpl.h"
    3234
  • trunk/src/VBox/Main/src-all/SharedFolderImpl.cpp

    r44528 r46820  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1717
    1818#include "SharedFolderImpl.h"
    19 #include "VirtualBoxImpl.h"
    20 #include "MachineImpl.h"
     19#if !defined(VBOX_COM_INPROC)
     20# include "VirtualBoxImpl.h"
     21# include "MachineImpl.h"
     22#endif
    2123#include "ConsoleImpl.h"
    2224
     
    5153SharedFolder::SharedFolder()
    5254    : mParent(NULL),
     55#if !defined(VBOX_COM_INPROC)
    5356      mMachine(NULL),
    54       mConsole(NULL),
    5557      mVirtualBox(NULL)
     58#else
     59      mConsole(NULL)
     60#endif
    5661{
    5762    m = new Data;
     
    7883/////////////////////////////////////////////////////////////////////////////
    7984
     85#if !defined(VBOX_COM_INPROC)
    8086/**
    8187 *  Initializes the shared folder object.
     
    148154}
    149155
     156# if 0
     157
     158/**
     159 *  Initializes the shared folder object.
     160 *
     161 *  This variant initializes a global instance that lives in the server address space. It is not presently used.
     162 *
     163 *  @param aVirtualBox  VirtualBox parent object
     164 *  @param aName        logical name of the shared folder
     165 *  @param aHostPath    full path to the shared folder on the host
     166 *  @param aWritable    writable if true, readonly otherwise
     167 *  @param fFailOnError Whether to fail with an error if the shared folder path is bad.
     168 *
     169 *  @return          COM result indicator
     170 */
     171HRESULT SharedFolder::init(VirtualBox *aVirtualBox,
     172                           const Utf8Str &aName,
     173                           const Utf8Str &aHostPath,
     174                           bool aWritable,
     175                           bool aAutoMount,
     176                           bool fFailOnError)
     177{
     178    /* Enclose the state transition NotReady->InInit->Ready */
     179    AutoInitSpan autoInitSpan(this);
     180    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     181
     182    unconst(mVirtualBox) = aVirtualBox;
     183
     184    HRESULT rc = protectedInit(aVirtualBox, aName, aHostPath, aWritable, aAutoMount);
     185
     186    /* Confirm a successful initialization when it's the case */
     187    if (SUCCEEDED(rc))
     188        autoInitSpan.setSucceeded();
     189
     190    return rc;
     191}
     192
     193# endif
     194
     195#else
     196
    150197/**
    151198 *  Initializes the shared folder object.
     
    182229    return rc;
    183230}
    184 
    185 #if 0
    186 
    187 /**
    188  *  Initializes the shared folder object.
    189  *
    190  *  This variant initializes a global instance that lives in the server address space. It is not presently used.
    191  *
    192  *  @param aVirtualBox  VirtualBox parent object
    193  *  @param aName        logical name of the shared folder
    194  *  @param aHostPath    full path to the shared folder on the host
    195  *  @param aWritable    writable if true, readonly otherwise
    196  *  @param fFailOnError Whether to fail with an error if the shared folder path is bad.
    197  *
    198  *  @return          COM result indicator
    199  */
    200 HRESULT SharedFolder::init(VirtualBox *aVirtualBox,
    201                            const Utf8Str &aName,
    202                            const Utf8Str &aHostPath,
    203                            bool aWritable,
    204                            bool aAutoMount,
    205                            bool fFailOnError)
    206 {
    207     /* Enclose the state transition NotReady->InInit->Ready */
    208     AutoInitSpan autoInitSpan(this);
    209     AssertReturn(autoInitSpan.isOk(), E_FAIL);
    210 
    211     unconst(mVirtualBox) = aVirtualBox;
    212 
    213     HRESULT rc = protectedInit(aVirtualBox, aName, aHostPath, aWritable, aAutoMount);
    214 
    215     /* Confirm a successful initialization when it's the case */
    216     if (SUCCEEDED(rc))
    217         autoInitSpan.setSucceeded();
    218 
    219     return rc;
    220 }
    221 
    222231#endif
    223232
     
    305314    unconst(mParent) = NULL;
    306315
     316#if !defined(VBOX_COM_INPROC)
    307317    unconst(mMachine) = NULL;
     318    unconst(mVirtualBox) = NULL;
     319#else
    308320    unconst(mConsole) = NULL;
    309     unconst(mVirtualBox) = NULL;
     321#endif
    310322}
    311323
  • trunk/src/VBox/Main/src-server/BandwidthControlImpl.cpp

    r42551 r46820  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626
    2727#include <iprt/cpp/utils.h>
     28#include <VBox/com/array.h>
     29#include <algorithm>
    2830
    2931// defines
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r46434 r46820  
    55
    66/*
    7  * Copyright (C) 2004-2012 Oracle Corporation
     7 * Copyright (C) 2004-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    158158
    159159#include "VBox/com/MultiResult.h"
     160#include "VBox/com/array.h"
    160161
    161162#include <stdio.h>
     
    28942895    listCopy = list;
    28952896    HostNetworkInterfaceList::iterator itOld, itNew;
     2897# ifdef VBOX_WITH_RESOURCE_USAGE_API
    28962898    PerformanceCollector *aCollector = m->pParent->performanceCollector();
     2899# endif
    28972900    for (itOld = m->llNetIfs.begin(); itOld != m->llNetIfs.end(); ++itOld)
    28982901    {
     
    29122915        }
    29132916        if (fGone)
     2917        {
     2918# ifdef VBOX_WITH_RESOURCE_USAGE_API
    29142919            (*itOld)->unregisterMetrics(aCollector, this);
     2920# endif
     2921        }
    29152922    }
    29162923    /*
     
    29322939        }
    29332940        else if (t == HostNetworkInterfaceType_Bridged)
     2941        {
     2942# ifdef VBOX_WITH_RESOURCE_USAGE_API
    29342943            (*itNew)->registerMetrics(aCollector, this);
     2944# endif
     2945        }
    29352946    }
    29362947    m->llNetIfs = list;
     
    31713182}
    31723183
     3184#endif /* VBOX_WITH_RESOURCE_USAGE_API */
     3185
    31733186
    31743187/* static */
     
    31863199}
    31873200
    3188 #endif /* VBOX_WITH_RESOURCE_USAGE_API */
    3189 
    31903201/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp

    r44039 r46820  
    77
    88/*
    9  * Copyright (C) 2006-2012 Oracle Corporation
     9 * Copyright (C) 2006-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2222#include "Logging.h"
    2323#include "netif.h"
    24 #include "Performance.h"
    25 #include "PerformanceImpl.h"
     24#ifdef VBOX_WITH_RESOURCE_USAGE_API
     25# include "Performance.h"
     26# include "PerformanceImpl.h"
     27#endif
    2628
    2729#include <iprt/cpp/utils.h>
     
    8688    return S_OK;
    8789}
     90
     91#ifdef VBOX_WITH_RESOURCE_USAGE_API
    8892
    8993void HostNetworkInterface::registerMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr)
     
    140144    aCollector->unregisterBaseMetricsFor(objptr, name);
    141145}
     146
     147#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    142148
    143149#ifdef VBOX_WITH_HOSTNETIF_API
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r46816 r46820  
    252252/////////////////////////////////////////////////////////////////////////////
    253253
    254 Machine::Machine()
    255     : mCollectorGuest(NULL),
    256       mPeer(NULL),
    257       mParent(NULL),
    258       mSerialPorts(),
    259       mParallelPorts(),
    260       uRegistryNeedsSaving(0)
     254Machine::Machine() :
     255#ifdef VBOX_WITH_RESOURCE_USAGE_API
     256    mCollectorGuest(NULL),
     257#endif
     258    mPeer(NULL),
     259    mParent(NULL),
     260    mSerialPorts(),
     261    mParallelPorts(),
     262    uRegistryNeedsSaving(0)
    261263{}
    262264
     
    1258212584    AutoMultiWriteLock3 multilock(mParent, mParent->host(), this COMMA_LOCKVAL_SRC_POS);
    1258312585
    12584 #if 0
    12585     // Trigger async cleanup tasks, avoid doing things here which are not
    12586     // vital to be done immediately and maybe need more locks. This calls
    12587     // Machine::unregisterMetrics().
    12588     mParent->onMachineUninit(mPeer);
    12589 #else
     12586#ifdef VBOX_WITH_RESOURCE_USAGE_API
    1259012587    /*
    1259112588     * It is safe to call Machine::unregisterMetrics() here because
     
    1259412591     */
    1259512592    unregisterMetrics(mParent->performanceCollector(), mPeer);
    12596 #endif
    1259712593    /* The guest must be unregistered after its metrics (@bugref{5949}). */
    1259812594    LogAleksey(("{%p} " LOG_FN_FMT ": mCollectorGuest=%p\n",
     
    1260412600        mCollectorGuest = NULL;
    1260512601    }
     12602#endif
    1260612603
    1260712604    if (aReason == Uninit::Abnormal)
     
    1279712794                                                ULONG aVmNetRx, ULONG aVmNetTx)
    1279812795{
     12796#ifdef VBOX_WITH_RESOURCE_USAGE_API
    1279912797    if (mCollectorGuest)
    1280012798        mCollectorGuest->updateStats(aValidStats, aCpuUser, aCpuKernel, aCpuIdle,
     
    1280412802
    1280512803    return S_OK;
     12804#else
     12805    NOREF(aValidStats);
     12806    NOREF(aCpuUser);
     12807    NOREF(aCpuKernel);
     12808    NOREF(aCpuIdle);
     12809    NOREF(aMemTotal);
     12810    NOREF(aMemFree);
     12811    NOREF(aMemBalloon);
     12812    NOREF(aMemShared);
     12813    NOREF(aMemCache);
     12814    NOREF(aPageTotal);
     12815    NOREF(aAllocVMM);
     12816    NOREF(aFreeVMM);
     12817    NOREF(aBalloonedVMM);
     12818    NOREF(aSharedVMM);
     12819    NOREF(aVmNetRx);
     12820    NOREF(aVmNetTx);
     12821    return E_NOTIMPL;
     12822#endif
    1280612823}
    1280712824
  • trunk/src/VBox/Main/src-server/NATEngineImpl.cpp

    r45185 r46820  
    55
    66/*
    7  * Copyright (C) 2010-2012 Oracle Corporation
     7 * Copyright (C) 2010-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2727#include <VBox/err.h>
    2828#include <VBox/settings.h>
     29#include <VBox/com/array.h>
    2930
    3031
  • trunk/src/VBox/Main/src-server/USBControllerImpl.cpp

    r45367 r46820  
    55
    66/*
    7  * Copyright (C) 2005-2012 Oracle Corporation
     7 * Copyright (C) 2005-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434#include <VBox/err.h>
    3535#include <VBox/settings.h>
     36#include <VBox/com/array.h>
    3637
    3738#include <algorithm>
  • trunk/src/VBox/Main/src-server/VRDEServerImpl.cpp

    r46610 r46820  
    3030#include <VBox/err.h>
    3131#include <VBox/sup.h>
     32#include <VBox/com/array.h>
    3233
    3334#include <VBox/RemoteDesktop/VRDE.h>
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