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

Unified Diff: base/posix/global_descriptors.h

Issue 2684433003: Files required by a service now listed in manifest. (Closed)
Patch Set: Fix build. Created 3 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 | « base/file_descriptor_store.cc ('k') | base/posix/global_descriptors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « base/file_descriptor_store.cc ('k') | base/posix/global_descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698