VirtualBox

Ignore:
Timestamp:
Jan 20, 2014 2:05:02 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91661
Message:

Main+Frontends: clear out some cruft code, outdated EventQueue stuff and whitespace cleanup

File:
1 edited

Legend:

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

    r47117 r50117  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9292 */
    9393
    94 NS_DECL_CLASSINFO (VirtualBox)
    95 NS_IMPL_CI_INTERFACE_GETTER1 (VirtualBox, IVirtualBox)
     94NS_DECL_CLASSINFO(VirtualBox)
     95NS_IMPL_CI_INTERFACE_GETTER1(VirtualBox, IVirtualBox)
    9696
    9797static nsresult vboxsvcSpawnDaemon(void)
     
    168168 */
    169169static NS_IMETHODIMP
    170 VirtualBoxConstructor (nsISupports *aOuter, REFNSIID aIID,
    171                        void **aResult)
     170VirtualBoxConstructor(nsISupports *aOuter, REFNSIID aIID,
     171                      void **aResult)
    172172{
    173173    LogFlowFuncEnter();
     
    189189            /* Get the directory containing XPCOM components -- the VBoxSVC
    190190             * executable is expected in the parent directory. */
    191             nsCOMPtr <nsIProperties> dirServ = do_GetService (NS_DIRECTORY_SERVICE_CONTRACTID, &rc);
     191            nsCOMPtr<nsIProperties> dirServ = do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rc);
    192192            if (NS_SUCCEEDED(rc))
    193193            {
    194                 nsCOMPtr <nsIFile> componentDir;
    195                 rc = dirServ->Get (NS_XPCOM_COMPONENT_DIR,
    196                                    NS_GET_IID (nsIFile), getter_AddRefs (componentDir));
     194                nsCOMPtr<nsIFile> componentDir;
     195                rc = dirServ->Get(NS_XPCOM_COMPONENT_DIR,
     196                                  NS_GET_IID(nsIFile), getter_AddRefs(componentDir));
    197197
    198198                if (NS_SUCCEEDED(rc))
    199199                {
    200200                    nsCAutoString path;
    201                     componentDir->GetNativePath (path);
    202 
    203                     LogFlowFunc (("component directory = \"%s\"\n", path.get()));
    204                     AssertBreakStmt (path.Length() + strlen (VBoxSVC_exe) < RTPATH_MAX,
    205                                      rc = NS_ERROR_FAILURE);
     201                    componentDir->GetNativePath(path);
     202
     203                    LogFlowFunc(("component directory = \"%s\"\n", path.get()));
     204                    AssertBreakStmt(path.Length() + strlen(VBoxSVC_exe) < RTPATH_MAX,
     205                                    rc = NS_ERROR_FAILURE);
    206206
    207207#if defined(RT_OS_SOLARIS) && defined(VBOX_WITH_HARDENING)
    208208                    char achKernArch[128];
    209                     int cbKernArch = sysinfo (SI_ARCHITECTURE_K, achKernArch, sizeof(achKernArch));
     209                    int cbKernArch = sysinfo(SI_ARCHITECTURE_K, achKernArch, sizeof(achKernArch));
    210210                    if (cbKernArch > 0)
    211211                    {
     
    216216                        rc = NS_ERROR_UNEXPECTED;
    217217#else
    218                     strcpy (VBoxSVCPath, path.get());
    219                     RTPathStripFilename (VBoxSVCPath);
    220                     strcat (VBoxSVCPath, VBoxSVC_exe);
     218                    strcpy(VBoxSVCPath, path.get());
     219                    RTPathStripFilename(VBoxSVCPath);
     220                    strcat(VBoxSVCPath, VBoxSVC_exe);
    221221
    222222                    IsVBoxSVCPathSet = true;
     
    228228        }
    229229
    230         nsCOMPtr <ipcIService> ipcServ = do_GetService (IPC_SERVICE_CONTRACTID, &rc);
     230        nsCOMPtr<ipcIService> ipcServ = do_GetService(IPC_SERVICE_CONTRACTID, &rc);
    231231        if (NS_FAILED(rc))
    232232            break;
     
    239239        do
    240240        {
    241             LogFlowFunc (("Resolving server name \"%s\"...\n", VBOXSVC_IPC_NAME));
     241            LogFlowFunc(("Resolving server name \"%s\"...\n", VBOXSVC_IPC_NAME));
    242242
    243243            PRUint32 serverID = 0;
    244             rc = ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID);
     244            rc = ipcServ->ResolveClientName(VBOXSVC_IPC_NAME, &serverID);
    245245            if (NS_FAILED(rc))
    246246            {
    247                 LogFlowFunc (("Starting server \"%s\"...\n", VBoxSVCPath));
     247                LogFlowFunc(("Starting server \"%s\"...\n", VBoxSVCPath));
    248248
    249249                startedOnce = true;
     
    256256                do
    257257                {
    258                     RTThreadSleep (VBoxSVC_WaitSlice);
    259                     rc = ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID);
     258                    RTThreadSleep(VBoxSVC_WaitSlice);
     259                    rc = ipcServ->ResolveClientName(VBOXSVC_IPC_NAME, &serverID);
    260260                    if (NS_SUCCEEDED(rc))
    261261                        break;
     
    276276            }
    277277
    278             LogFlowFunc (("Connecting to server (ID=%d)...\n", serverID));
    279 
    280             nsCOMPtr <ipcIDConnectService> dconServ =
    281                 do_GetService (IPC_DCONNECTSERVICE_CONTRACTID, &rc);
     278            LogFlowFunc(("Connecting to server (ID=%d)...\n", serverID));
     279
     280            nsCOMPtr<ipcIDConnectService> dconServ =
     281                do_GetService(IPC_DCONNECTSERVICE_CONTRACTID, &rc);
    282282            if (NS_FAILED(rc))
    283283                break;
    284284
    285             rc = dconServ->CreateInstance (serverID,
    286                                            CLSID_VirtualBox,
    287                                            aIID, aResult);
     285            rc = dconServ->CreateInstance(serverID,
     286                                          CLSID_VirtualBox,
     287                                          aIID, aResult);
    288288            if (NS_SUCCEEDED(rc))
    289289                break;
    290290
    291             LogFlowFunc (("Failed to connect (rc=%Rhrc (%#08x))\n", rc, rc));
     291            LogFlowFunc(("Failed to connect (rc=%Rhrc (%#08x))\n", rc, rc));
    292292
    293293            /* It's possible that the server gets shut down after we
     
    298298            {
    299299                nsresult rc2 =
    300                     ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID);
     300                    ipcServ->ResolveClientName(VBOXSVC_IPC_NAME, &serverID);
    301301                if (NS_SUCCEEDED(rc2))
    302302                    break;
    303303
    304                 LogFlowFunc (("Server seems to have terminated before "
    305                               "receiving our request. Will try again.\n"));
     304                LogFlowFunc(("Server seems to have terminated before receiving our request. Will try again.\n"));
    306305            }
    307306            else
     
    312311    while (0);
    313312
    314     LogFlowFunc (("rc=%Rhrc (%#08x), vrc=%Rrc\n", rc, rc, vrc));
     313    LogFlowFunc(("rc=%Rhrc (%#08x), vrc=%Rrc\n", rc, rc, vrc));
    315314    LogFlowFuncLeave();
    316315
     
    331330 */
    332331static NS_IMETHODIMP
    333 VirtualBoxRegistration (nsIComponentManager *aCompMgr,
    334                         nsIFile *aPath,
    335                         const char *aLoaderStr,
    336                         const char *aType,
    337                         const nsModuleComponentInfo *aInfo)
     332VirtualBoxRegistration(nsIComponentManager *aCompMgr,
     333                       nsIFile *aPath,
     334                       const char *aLoaderStr,
     335                       const char *aType,
     336                       const nsModuleComponentInfo *aInfo)
    338337{
    339338    nsCAutoString modulePath;
    340     aPath->GetNativePath (modulePath);
     339    aPath->GetNativePath(modulePath);
    341340    nsCAutoString moduleTarget;
    342     aPath->GetNativeTarget (moduleTarget);
    343 
    344     LogFlowFunc (("aPath=%s, aTarget=%s, aLoaderStr=%s, aType=%s\n",
    345                   modulePath.get(), moduleTarget.get(), aLoaderStr, aType));
     341    aPath->GetNativeTarget(moduleTarget);
     342
     343    LogFlowFunc(("aPath=%s, aTarget=%s, aLoaderStr=%s, aType=%s\n",
     344                 modulePath.get(), moduleTarget.get(), aLoaderStr, aType));
    346345
    347346    nsresult rc = NS_OK;
     
    372371};
    373372
    374 NS_IMPL_NSGETMODULE (VirtualBox_Server_Module, components)
     373NS_IMPL_NSGETMODULE(VirtualBox_Server_Module, components)
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