diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-04 00:44:22 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-04 00:44:22 +0000 |
commit | f25810a9541a15facf4252236432335629d10e50 (patch) | |
tree | 57683e84011e81bc35241dc88ffd856f769f1c0d /base/shared_memory_posix.cc | |
parent | b5610509b9743199b430fcb6481e26a80e1eb6c9 (diff) | |
download | chromium_src-f25810a9541a15facf4252236432335629d10e50.zip chromium_src-f25810a9541a15facf4252236432335629d10e50.tar.gz chromium_src-f25810a9541a15facf4252236432335629d10e50.tar.bz2 |
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
Diffstat (limited to 'base/shared_memory_posix.cc')
-rw-r--r-- | base/shared_memory_posix.cc | 11 |
1 files changed, 4 insertions, 7 deletions
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; |