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

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

Issue 3225010: Pull seccomp-sandbox in via DEPS rather than using an in-tree copy... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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/madvise.cc ('k') | sandbox/linux/seccomp/maps.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp/maps.h
===================================================================
--- sandbox/linux/seccomp/maps.h (revision 57969)
+++ sandbox/linux/seccomp/maps.h (working copy)
@@ -1,94 +0,0 @@
-// 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.
-
-#ifndef MAPS_H__
-#define MAPS_H__
-
-#include <elf.h>
-#include <functional>
-#include <map>
-#include <string>
-
-#include "allocator.h"
-
-#if defined(__x86_64__)
-typedef Elf64_Addr Elf_Addr;
-#elif defined(__i386__)
-typedef Elf32_Addr Elf_Addr;
-#else
-#error Undefined target platform
-#endif
-
-namespace playground {
-
-class Library;
-class Maps {
- friend class Library;
- public:
- typedef std::basic_string<char, std::char_traits<char>,
- SystemAllocator<char> > string;
-
- Maps(int proc_self_maps);
- ~Maps() { }
-
- protected:
- // A map with all the libraries currently loaded into the application.
- // The key is a unique combination of device number, inode number, and
- // file name. It should be treated as opaque.
- typedef std::map<string, Library, std::less<string>,
- SystemAllocator<std::pair<const string,
- Library> > > LibraryMap;
- friend class Iterator;
- class Iterator {
- friend class Maps;
-
- protected:
- explicit Iterator(Maps* maps);
- Iterator(Maps* maps, bool at_beginning, bool at_end);
- Maps::LibraryMap::iterator& getIterator() const;
-
- public:
- Iterator begin();
- Iterator end();
- Iterator& operator++();
- Iterator operator++(int i);
- Library* operator*() const;
- bool operator==(const Iterator& iter) const;
- bool operator!=(const Iterator& iter) const;
- string name() const;
-
- protected:
- mutable LibraryMap::iterator iter_;
- Maps *maps_;
- bool at_beginning_;
- bool at_end_;
- };
-
- public:
- typedef class Iterator const_iterator;
-
- const_iterator begin() {
- return begin_iter_;
- }
-
- const_iterator end() {
- return end_iter_;
- }
-
- char* allocNearAddr(char *addr, size_t size, int prot) const;
-
- char* vsyscall() const { return vsyscall_; }
-
- protected:
- const int proc_self_maps_;
- const Iterator begin_iter_;
- const Iterator end_iter_;
-
- LibraryMap libs_;
- char* vsyscall_;
-};
-
-} // namespace
-
-#endif // MAPS_H__
« no previous file with comments | « sandbox/linux/seccomp/madvise.cc ('k') | sandbox/linux/seccomp/maps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698