[zion] Remove legacy capability table method.
This commit is contained in:
		
							parent
							
								
									36a83b142b
								
							
						
					
					
						commit
						0b9e0adfbb
					
				| 
						 | 
				
			
			@ -16,17 +16,12 @@ class CapabilityTable {
 | 
			
		|||
  uint64_t AddNewCapability(const RefPtr<T>& object, uint64_t permissions);
 | 
			
		||||
  uint64_t AddExistingCapability(const RefPtr<Capability>& cap);
 | 
			
		||||
 | 
			
		||||
  // FIXME: Remove reliance on this.
 | 
			
		||||
  template <typename T>
 | 
			
		||||
  void AddNewCapabilityWithId(uint64_t id, const RefPtr<T>& object,
 | 
			
		||||
                              uint64_t permissions);
 | 
			
		||||
 | 
			
		||||
  RefPtr<Capability> GetCapability(uint64_t id);
 | 
			
		||||
  RefPtr<Capability> ReleaseCapability(uint64_t id);
 | 
			
		||||
 | 
			
		||||
 private:
 | 
			
		||||
  Mutex lock_{"cap table"};
 | 
			
		||||
  // FIXME: store this id here rather than in the capability.
 | 
			
		||||
  // TODO: Do some randomization.
 | 
			
		||||
  uint64_t next_cap_id_ = 0x100;
 | 
			
		||||
  // FIXME: use a map data structure.
 | 
			
		||||
  struct CapEntry {
 | 
			
		||||
| 
						 | 
				
			
			@ -45,11 +40,3 @@ uint64_t CapabilityTable::AddNewCapability(const RefPtr<T>& object,
 | 
			
		|||
      {.id = id, .cap = MakeRefCounted<Capability>(object, permissions)});
 | 
			
		||||
  return id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <typename T>
 | 
			
		||||
void CapabilityTable::AddNewCapabilityWithId(uint64_t id,
 | 
			
		||||
                                             const RefPtr<T>& object,
 | 
			
		||||
                                             uint64_t permissions) {
 | 
			
		||||
  capabilities_.PushBack(
 | 
			
		||||
      {.id = id, .cap = MakeRefCounted<Capability>(object, permissions)});
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue