Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: content/child/child_shared_bitmap_manager.cc

Issue 799133003: Close renderer SharedBitmap file descriptors immediately after mapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_shared_bitmap_manager.cc
diff --git a/content/child/child_shared_bitmap_manager.cc b/content/child/child_shared_bitmap_manager.cc
index 9dc86bd679b50880c1c0cee97278f0b3d8e59c90..aa9f1f37ba6dd854418aab8be314b2ece5d091c4 100644
--- a/content/child/child_shared_bitmap_manager.cc
+++ b/content/child/child_shared_bitmap_manager.cc
@@ -55,7 +55,13 @@ ChildSharedBitmapManager::~ChildSharedBitmapManager() {}
scoped_ptr<cc::SharedBitmap> ChildSharedBitmapManager::AllocateSharedBitmap(
const gfx::Size& size) {
- return AllocateSharedMemoryBitmap(size);
+ scoped_ptr<SharedMemoryBitmap> bitmap = AllocateSharedMemoryBitmap(size);
+#if defined(OS_POSIX)
+ // Close file descriptor to avoid running out.
+ if (bitmap)
+ bitmap->shared_memory()->Close();
+#endif
+ return bitmap.Pass();
}
scoped_ptr<SharedMemoryBitmap>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698