#ifndef MOJO_SYSTEM_MAPPING_TABLE_H_
#define MOJO_SYSTEM_MAPPING_TABLE_H_
#include <stdint.h>
#include <vector>
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/public/c/system/core.h"
#include "mojo/system/system_impl_export.h"
namespace mojo {
namespace system {
class CoreImpl;
class RawSharedBufferMapping;
namespace internal {
bool ShutdownCheckNoLeaks(CoreImpl*);
}
class MOJO_SYSTEM_IMPL_EXPORT MappingTable {
public:
MappingTable();
~MappingTable();
MojoResult AddMapping(scoped_ptr<RawSharedBufferMapping> mapping);
MojoResult RemoveMapping(void* address);
private:
friend bool internal::ShutdownCheckNoLeaks(CoreImpl*);
typedef base::hash_map<uintptr_t, RawSharedBufferMapping*>
AddressToMappingMap;
AddressToMappingMap address_to_mapping_map_;
DISALLOW_COPY_AND_ASSIGN(MappingTable);
};
}
}
#endif