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

Unified Diff: content/browser/renderer_host/backing_store_gtk.cc

Issue 10854242: Make shared memory segments writable only by their rightful owners. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 months 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 | ui/base/x/x11_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/backing_store_gtk.cc
===================================================================
--- content/browser/renderer_host/backing_store_gtk.cc (revision 155390)
+++ content/browser/renderer_host/backing_store_gtk.cc (working copy)
@@ -519,10 +519,14 @@
return false;
}
shminfo.shmid = shmget(IPC_PRIVATE, image->bytes_per_line * image->height,
- IPC_CREAT|0666);
+ IPC_CREAT|0600);
if (shminfo.shmid == -1) {
XDestroyImage(image);
+ LOG(WARNING) << "Failed to get shared memory segment. "
Daniel Erat 2012/09/13 22:04:39 How frequently can this be logged?
palmer 2012/09/24 16:26:11 This one, once. Some of the other logging statemen
+ "Performance may be degraded.";
return false;
+ } else {
+ VLOG(1) << "Got shared memory segment " << shminfo.shmid;
}
void* mapped_memory = shmat(shminfo.shmid, NULL, SHM_RDONLY);
@@ -537,9 +541,14 @@
!XShmGetImage(display_, pixmap_, image, rect.x(), rect.y(),
AllPlanes)) {
DestroySharedImage(display_, image, &shminfo);
+ LOG(WARNING) << "X failed to get shared memory segment. "
+ "Performance may be degraded.";
return false;
}
+
+ VLOG(1) << "Using X shared memory segment " << shminfo.shmid;
} else {
+ LOG(WARNING) << "Not using X shared memory.";
// Non-shared memory case just copy the image from the server.
image = XGetImage(display_, pixmap_,
rect.x(), rect.y(), width, height,
« no previous file with comments | « no previous file | ui/base/x/x11_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698