From f25810a9541a15facf4252236432335629d10e50 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Sat, 4 Apr 2009 00:44:22 +0000 Subject: Remove unused variable from POSIX SharedMemory implementation. Review URL: http://codereview.chromium.org/62027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13129 0039d316-1c4b-4281-b951-d872f2087c98 --- base/shared_memory_posix.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'base/shared_memory_posix.cc') diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc index 37f0c4e..2f0fe22 100644 --- a/base/shared_memory_posix.cc +++ b/base/shared_memory_posix.cc @@ -134,11 +134,12 @@ bool SharedMemory::FilenameForMemoryName(const std::wstring &memname, return true; } -// Current expectation is that Cromium only really needs -// unique/private shmem as specified by "name == L"". -// TODO(port): confirm that assumption. +// Chromium mostly only use the unique/private shmem as specified by +// "name == L"". The exception is in the StatsTable. // TODO(jrg): there is no way to "clean up" all unused named shmem if // we restart from a crash. (That isn't a new problem, but it is a problem.) +// In case we want to delete it later, it may be useful to save the value +// of mem_filename after FilenameForMemoryName(). bool SharedMemory::CreateOrOpen(const std::wstring &name, int posix_flags, size_t size) { DCHECK(mapped_file_ == -1); @@ -152,7 +153,6 @@ bool SharedMemory::CreateOrOpen(const std::wstring &name, FilePath path; fp = file_util::CreateAndOpenTemporaryShmemFile(&path); - name_ = UTF8ToWide(path.value()); // Deleting the file prevents anyone else from mapping it in // (making it private), and prevents the need for cleanup (once @@ -163,7 +163,6 @@ bool SharedMemory::CreateOrOpen(const std::wstring &name, if (FilenameForMemoryName(name, &mem_filename) == false) return false; - name_ = mem_filename; std::string mode; switch (posix_flags) { case (O_RDWR | O_CREAT): @@ -271,10 +270,8 @@ bool SharedMemory::ShareToProcessCommon(ProcessHandle process, void SharedMemory::Close() { - Unmap(); - std::string posix_name(WideToUTF8(name_)); if (mapped_file_ > 0) { close(mapped_file_); mapped_file_ = -1; -- cgit v1.1