Bug 1440199 - Part 3: Remove IPC shared memory IDs. r=froydnj

This code isn't blocking anything, but it's dead and I don't think we
have any plans to use it.

MozReview-Commit-ID: KBoEfLceDns

--HG--
extra : rebase_source : 1eee3d961e249939f02d4cc40a707739eb2a596a
This commit is contained in:
Jed Davis 2018-02-20 15:09:12 -07:00
Родитель 91efa87e62
Коммит 59f1007c8e
2 изменённых файлов: 0 добавлений и 24 удалений

Просмотреть файл

@ -26,10 +26,7 @@ namespace base {
#if defined(OS_WIN)
typedef HANDLE SharedMemoryHandle;
#elif defined(OS_POSIX)
// A SharedMemoryId is sufficient to identify a given shared memory segment on a
// system, but insufficient to map it.
typedef FileDescriptor SharedMemoryHandle;
typedef ino_t SharedMemoryId;
#endif
// Platform abstraction for shared memory. Provides a C++ wrapper
@ -90,14 +87,6 @@ class SharedMemory {
// identifier is not portable.
SharedMemoryHandle handle() const;
#if defined(OS_POSIX)
// Return a unique identifier for this shared memory segment. Inode numbers
// are technically only unique to a single filesystem. However, we always
// allocate shared memory backing files from the same directory, so will end
// up on the same filesystem.
SharedMemoryId id() const { return inode_; }
#endif
// Closes the open shared memory segment.
// It is safe to call Close repeatedly.
void Close(bool unmap_view = true);
@ -133,7 +122,6 @@ class SharedMemory {
HANDLE mapped_file_;
#elif defined(OS_POSIX)
int mapped_file_;
ino_t inode_;
#endif
void* memory_;
bool read_only_;

Просмотреть файл

@ -22,7 +22,6 @@ namespace base {
SharedMemory::SharedMemory()
: mapped_file_(-1),
inode_(0),
memory_(NULL),
read_only_(false),
max_size_(0) {
@ -35,13 +34,7 @@ SharedMemory::~SharedMemory() {
bool SharedMemory::SetHandle(SharedMemoryHandle handle, bool read_only) {
DCHECK(mapped_file_ == -1);
struct stat st;
if (fstat(handle.fd, &st) < 0) {
return false;
}
mapped_file_ = handle.fd;
inode_ = st.st_ino;
read_only_ = read_only;
return true;
}
@ -109,11 +102,6 @@ bool SharedMemory::Create(size_t size) {
mapped_file_ = dup(fileno(fp));
DCHECK(mapped_file_ >= 0);
struct stat st;
if (fstat(mapped_file_, &st))
NOTREACHED();
inode_ = st.st_ino;
max_size_ = size;
return true;
}