Changeset 106878 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 8, 2024 8:24:40 AM (4 months ago)
- svn:sync-xref-src-repo-rev:
- 165799
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/VirtualBoxBase.h
r106061 r106878 675 675 #endif // !VBOX_WITH_XPCOM 676 676 677 678 677 /** 679 678 * Abstract base class for all component classes implementing COM … … 689 688 #if !defined (VBOX_WITH_XPCOM) 690 689 , public ISupportErrorInfo 690 #else 691 , public IUnknown 691 692 #endif 692 693 { … … 698 699 HRESULT BaseFinalConstruct(); 699 700 void BaseFinalRelease(); 701 702 HRESULT getObjectId(com::Guid &aId); 703 HRESULT setTracked(uint64_t aLifeTime = 0, uint64_t afterLifeTime = 0); 704 HRESULT invalidateTracked(); 700 705 701 706 public: … … 715 720 virtual void uninit() 716 721 { } 722 723 /** 724 */ 725 const Guid &getObjectGuid() const 726 { 727 return mObjectId; 728 } 717 729 718 730 /** … … 805 817 806 818 private: 819 /** Unique ID identifying an object */ 820 const Guid mObjectId; 821 822 /** Flag shows whether an object trackable or not */ 823 bool mfTracked; 824 807 825 /** Object for representing object state */ 808 826 ObjectState mState; … … 1117 1135 1118 1136 #endif /* !MAIN_INCLUDED_VirtualBoxBase_h */ 1119 -
trunk/src/VBox/Main/src-all/VirtualBoxBase.cpp
r106077 r106878 30 30 #include <iprt/asm.h> 31 31 #include <iprt/cpp/exception.h> 32 #include <iprt/cpp/utils.h> 32 33 33 34 #include <typeinfo> … … 47 48 #include "Global.h" 48 49 #include "LoggingNew.h" 50 #include "ObjectsTracker.h" 49 51 50 52 #include "VBox/com/ErrorInfo.h" … … 79 81 } 80 82 Assert(g_pClassFactoryStatsLock); 83 84 RTUUID uuid; 85 RTUuidCreate(&uuid); 86 unconst(mObjectId) = uuid; 81 87 } 82 88 … … 170 176 else 171 177 Assert(g_pClassFactoryStatsLock); 178 } 179 180 TrackedObjectsCollector gTrackedObjectsCollector; 181 182 HRESULT VirtualBoxBase::getObjectId(com::Guid &aId) 183 { 184 aId = mObjectId; 185 return S_OK; 186 } 187 188 HRESULT VirtualBoxBase::setTracked(uint64_t aLifeTime, uint64_t afterLifeTime) 189 { 190 Utf8Str strObjId = mObjectId.toString(); 191 Utf8Str strClassIID = Guid(getClassIID()).toString(); 192 HRESULT hrc = gTrackedObjectsCollector.setObj(strObjId, 193 strClassIID, 194 aLifeTime, 195 afterLifeTime, 196 /*ptrVirtualBoxBase,*/ 197 this); 198 Log2(("VirtualBoxBase::setTracked: inserted the Id %s for component %s with IID %s.\n", 199 strObjId.c_str(), getComponentName(), strClassIID.c_str())); 200 201 return hrc; 202 } 203 204 HRESULT VirtualBoxBase::invalidateTracked() 205 { 206 Utf8Str strObjId = mObjectId.toString(); 207 HRESULT hrc = gTrackedObjectsCollector.invalidateObj(strObjId); 208 209 return hrc; 172 210 } 173 211
Note:
See TracChangeset
for help on using the changeset viewer.