Changeset 40212 in vbox
- Timestamp:
- Feb 22, 2012 2:32:06 PM (13 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r40084 r40212 8351 8351 <desc>VirtualBox base driver (VBoxGuest).</desc> 8352 8352 </const> 8353 <const name="AutoLogon" value="90"> 8354 <desc>Auto-logon modules (VBoxGINA, VBoxCredProv, pam_vbox).</desc> 8355 </const> 8353 8356 <const name="VBoxService" value="100"> 8354 8357 <desc>VirtualBox system service (VBoxService).</desc> -
trunk/src/VBox/Main/include/AdditionsFacilityImpl.h
r39890 r40212 4 4 5 5 /* 6 * Copyright (C) 201 1Oracle Corporation6 * Copyright (C) 2012 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 18 18 #define ____H_ADDITIONSFACILITYIMPL 19 19 20 #include <vector> 21 #include <iprt/time.h> 22 20 23 #include "VirtualBoxBase.h" 21 #include <iprt/time.h>22 24 23 25 class Guest; … … 60 62 { 61 63 /** The facilitie's name. */ 62 const char *mName; /* utf-8 */64 const char *mName; /* utf-8 */ 63 65 /** The facilitie's type. */ 64 66 AdditionsFacilityType_T mType; … … 78 80 79 81 private: 82 /** A structure for keeping a facility status 83 * set at a certain time. Good for book-keeping. */ 84 struct FacilityState 85 { 86 RTTIMESPEC mTimestamp; 87 /** The facilitie's current status. */ 88 AdditionsFacilityStatus_T mStatus; 89 }; 90 80 91 struct Data 81 92 { 82 /** Timestamp of last updated status. 83 * @todo Add a UpdateRecord struct to keep track of all 84 * status changed + their time; nice for some GUIs. */ 85 RTTIMESPEC mLastUpdated; 86 /** The facilitie's current status. */ 87 AdditionsFacilityStatus_T mStatus; 93 /** Record of current and previous facility 94 * states, limited to the 10 last states set. 95 * Note: This intentionally only is kept in 96 * Main so far! */ 97 std::vector<FacilityState> mStates; 88 98 /** The facilitie's ID/type. */ 89 AdditionsFacilityType_T mType;99 AdditionsFacilityType_T mType; 90 100 } mData; 91 101 }; -
trunk/src/VBox/Main/src-client/AdditionsFacilityImpl.cpp
r39890 r40212 5 5 6 6 /* 7 * Copyright (C) 201 1Oracle Corporation7 * Copyright (C) 2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 28 28 { "Unknown", AdditionsFacilityType_None, AdditionsFacilityClass_None }, 29 29 { "VirtualBox Base Driver", AdditionsFacilityType_VBoxGuestDriver, AdditionsFacilityClass_Driver }, 30 { "Auto Logon", AdditionsFacilityType_AutoLogon, AdditionsFacilityClass_Feature }, 30 31 { "VirtualBox System Service", AdditionsFacilityType_VBoxService, AdditionsFacilityClass_Service }, 31 32 { "VirtualBox Desktop Integration", AdditionsFacilityType_VBoxTrayClient, AdditionsFacilityClass_Program }, … … 65 66 AssertReturn(autoInitSpan.isOk(), E_FAIL); 66 67 67 mData.mStatus = a_enmStatus; 68 mData.mType = a_enmFacility; 69 mData.mLastUpdated = *a_pTimeSpecTS; 68 FacilityState state; 69 state.mStatus = a_enmStatus; 70 state.mTimestamp = *a_pTimeSpecTS; 71 NOREF(a_fFlags); 72 73 Assert(mData.mStates.size() == 0); 74 mData.mStates.push_back(state); 75 mData.mType = a_enmFacility; 70 76 /** @todo mClass is not initialized here. */ 71 77 NOREF(a_fFlags); … … 89 95 if (autoUninitSpan.uninitDone()) 90 96 return; 97 98 mData.mStates.clear(); 91 99 } 92 100 … … 193 201 LONG64 AdditionsFacility::getLastUpdated() const 194 202 { 195 return RTTimeSpecGetMilli(&mData.mLastUpdated); 203 if (mData.mStates.size()) 204 return RTTimeSpecGetMilli(&mData.mStates.front().mTimestamp); 205 206 AssertMsgFailed(("Unknown timestamp of facility!\n")); 207 return 0; /* Should never happen! */ 196 208 } 197 209 198 210 AdditionsFacilityStatus_T AdditionsFacility::getStatus() const 199 211 { 200 return mData.mStatus; 212 if (mData.mStates.size()) 213 return mData.mStates.back().mStatus; 214 215 AssertMsgFailed(("Unknown status of facility!\n")); 216 return AdditionsFacilityStatus_Unknown; /* Should never happen! */ 201 217 } 202 218 … … 211 227 void AdditionsFacility::update(AdditionsFacilityStatus_T a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS) 212 228 { 213 mData.mStatus = a_enmStatus; 214 mData.mLastUpdated = *a_pTimeSpecTS; 229 FacilityState state; 230 state.mStatus = a_enmStatus; 231 state.mTimestamp = *a_pTimeSpecTS; 215 232 NOREF(a_fFlags); 216 } 217 233 234 mData.mStates.push_back(state); 235 if (mData.mStates.size() > 10) /* Only keep the last 10 states. */ 236 mData.mStates.erase(mData.mStates.begin()); 237 } 238
Note:
See TracChangeset
for help on using the changeset viewer.