Index: base/posix/global_descriptors.h |
diff --git a/base/posix/global_descriptors.h b/base/posix/global_descriptors.h |
index 30db2b7ab729cb7838aff873e0982345f1b8736f..9d68761f237779681ad6e665f368494f7f489d8f 100644 |
--- a/base/posix/global_descriptors.h |
+++ b/base/posix/global_descriptors.h |
@@ -13,6 +13,7 @@ |
#include <stdint.h> |
#include "base/files/memory_mapped_file.h" |
+#include "base/files/scoped_file.h" |
#include "base/memory/singleton.h" |
namespace base { |
@@ -34,6 +35,10 @@ namespace base { |
// It maps from an abstract key to a descriptor. If independent modules each |
// need to define keys, then values should be chosen randomly so as not to |
// collide. |
+// |
+// Note that this class is deprecated and passing file descriptor should ideally |
+// be done through the command line and using FileDescriptorStore. |
+// See https://crbugs.com/detail?id=692619 |
class BASE_EXPORT GlobalDescriptors { |
public: |
typedef uint32_t Key; |
@@ -63,6 +68,11 @@ class BASE_EXPORT GlobalDescriptors { |
// Get a descriptor given a key. Returns -1 on error. |
int MaybeGet(Key key) const; |
+ // Returns a descriptor given a key and removes it from this class mappings. |
+ // Also populates |region|. |
+ // It is a fatal error if the key is not known. |
+ base::ScopedFD TakeFD(Key key, base::MemoryMappedFile::Region* region); |
+ |
// Get a region given a key. It is a fatal error if the key is not known. |
base::MemoryMappedFile::Region GetRegion(Key key) const; |