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

Side by Side Diff: mojo/system/mapping_table.h

Issue 418033005: Mojo: Change how we handle invalid pointer arguments (at the system layer). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/system/entrypoints.cc ('k') | mojo/system/mapping_table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SYSTEM_MAPPING_TABLE_H_ 5 #ifndef MOJO_SYSTEM_MAPPING_TABLE_H_
6 #define MOJO_SYSTEM_MAPPING_TABLE_H_ 6 #define MOJO_SYSTEM_MAPPING_TABLE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 21 matching lines...) Expand all
32 // 32 //
33 // This class is NOT thread-safe; locking is left to |Core|. 33 // This class is NOT thread-safe; locking is left to |Core|.
34 class MOJO_SYSTEM_IMPL_EXPORT MappingTable { 34 class MOJO_SYSTEM_IMPL_EXPORT MappingTable {
35 public: 35 public:
36 MappingTable(); 36 MappingTable();
37 ~MappingTable(); 37 ~MappingTable();
38 38
39 // Tries to add a mapping. (Takes ownership of the mapping in all cases; on 39 // Tries to add a mapping. (Takes ownership of the mapping in all cases; on
40 // failure, it will be destroyed.) 40 // failure, it will be destroyed.)
41 MojoResult AddMapping(scoped_ptr<RawSharedBufferMapping> mapping); 41 MojoResult AddMapping(scoped_ptr<RawSharedBufferMapping> mapping);
42 MojoResult RemoveMapping(void* address); 42 MojoResult RemoveMapping(uintptr_t address);
43 43
44 private: 44 private:
45 friend bool internal::ShutdownCheckNoLeaks(Core*); 45 friend bool internal::ShutdownCheckNoLeaks(Core*);
46 46
47 typedef base::hash_map<uintptr_t, RawSharedBufferMapping*> 47 typedef base::hash_map<uintptr_t, RawSharedBufferMapping*>
48 AddressToMappingMap; 48 AddressToMappingMap;
49 AddressToMappingMap address_to_mapping_map_; 49 AddressToMappingMap address_to_mapping_map_;
50 50
51 DISALLOW_COPY_AND_ASSIGN(MappingTable); 51 DISALLOW_COPY_AND_ASSIGN(MappingTable);
52 }; 52 };
53 53
54 } // namespace system 54 } // namespace system
55 } // namespace mojo 55 } // namespace mojo
56 56
57 #endif // MOJO_SYSTEM_MAPPING_TABLE_H_ 57 #endif // MOJO_SYSTEM_MAPPING_TABLE_H_
OLDNEW
« no previous file with comments | « mojo/system/entrypoints.cc ('k') | mojo/system/mapping_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698