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

Unified Diff: sandbox/linux/seccomp/maps.cc

Issue 661438: Seccomp sandbox changes (performance and correctness fixes, primarily targetting x86-32) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 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 | « sandbox/linux/seccomp/maps.h ('k') | sandbox/linux/seccomp/sandbox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp/maps.cc
===================================================================
--- sandbox/linux/seccomp/maps.cc (revision 39965)
+++ sandbox/linux/seccomp/maps.cc (working copy)
@@ -1,3 +1,7 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
#include <errno.h>
#include <fcntl.h>
#include <iostream>
@@ -42,18 +46,18 @@
while (*ptr == ' ' || *ptr == '\t') ++ptr;
char *perm_ptr = ptr;
while (*ptr && *ptr != ' ' && *ptr != '\t') ++ptr;
- std::string perm(perm_ptr, ptr - perm_ptr);
+ string perm(perm_ptr, ptr - perm_ptr);
unsigned long offset = strtoul(ptr, &ptr, 16);
while (*ptr == ' ' || *ptr == '\t') ++ptr;
char *id_ptr = ptr;
while (*ptr && *ptr != ' ' && *ptr != '\t') ++ptr;
while (*ptr == ' ' || *ptr == '\t') ++ptr;
while (*ptr && *ptr != ' ' && *ptr != '\t') ++ptr;
- std::string id(id_ptr, ptr - id_ptr);
+ string id(id_ptr, ptr - id_ptr);
while (*ptr == ' ' || *ptr == '\t') ++ptr;
char *library_ptr = ptr;
while (*ptr && *ptr != ' ' && *ptr != '\t' && *ptr != '\n') ++ptr;
- std::string library(library_ptr, ptr - library_ptr);
+ string library(library_ptr, ptr - library_ptr);
bool isVDSO = false;
if (library == "[vdso]") {
// /proc/self/maps has a misleading file offset in the [vdso] entry.
@@ -66,13 +70,13 @@
goto skip_entry;
}
int prot = 0;
- if (perm.find('r') != std::string::npos) {
+ if (perm.find('r') != string::npos) {
prot |= PROT_READ;
}
- if (perm.find('w') != std::string::npos) {
+ if (perm.find('w') != string::npos) {
prot |= PROT_WRITE;
}
- if (perm.find('x') != std::string::npos) {
+ if (perm.find('x') != string::npos) {
prot |= PROT_EXEC;
}
if ((prot & (PROT_EXEC | PROT_READ)) == 0) {
@@ -146,7 +150,7 @@
return !operator==(iter);
}
-std::string Maps::Iterator::name() const {
+Maps::string Maps::Iterator::name() const {
return getIterator()->first;
}
« no previous file with comments | « sandbox/linux/seccomp/maps.h ('k') | sandbox/linux/seccomp/sandbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698