Make shared memory segments writable only by their rightful owners.

BUG=143859
TEST=Chrome's UI still works on Linux and Chrome OS
Review URL: https://chromiumcodereview.appspot.com/10854242

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158289 0039d316-1c4b-4281-b951-d872f2087c98
std::vector<std::string> GetOutputNames(const std::vector<XID>& output_ids) {
  std::vector<std::string> names;
  Display* display = GetXDisplay();
  Window root_window = DefaultRootWindow(display);
  XRRScreenResources* screen_resources =
      XRRGetScreenResources(display, root_window);
  for (std::vector<XID>::const_iterator iter = output_ids.begin();
       iter != output_ids.end(); ++iter) {
    XRROutputInfo* output =
        XRRGetOutputInfo(display, screen_resources, *iter);
    names.push_back(std::string(output->name));
    XRRFreeOutputInfo(output);
  }
  XRRFreeScreenResources(screen_resources);
  return names;
}

std::vector<std::string> GetOutputNames(const std::vector<XID>& output_ids) {
  std::vector<std::string> names;
  Display* display = GetXDisplay();
  Window root_window = DefaultRootWindow(display);
  XRRScreenResources* screen_resources =
      XRRGetScreenResources(display, root_window);
  for (std::vector<XID>::const_iterator iter = output_ids.begin();
       iter != output_ids.end(); ++iter) {
    XRROutputInfo* output =
        XRRGetOutputInfo(display, screen_resources, *iter);
    names.push_back(std::string(output->name));
    XRRFreeOutputInfo(output);
  }
  XRRFreeScreenResources(screen_resources);
  return names;
}
