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

Unified Diff: base/posix/global_descriptors.cc

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/posix/global_descriptors.h ('k') | content/app/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/posix/global_descriptors.cc
diff --git a/base/posix/global_descriptors.cc b/base/posix/global_descriptors.cc
index 6c187838ad69d63051a1155d64c26623de8a2db0..8da808e52d977f5d1036b0a61902bb3799c1c7ff 100644
--- a/base/posix/global_descriptors.cc
+++ b/base/posix/global_descriptors.cc
@@ -47,6 +47,22 @@ int GlobalDescriptors::MaybeGet(Key key) const {
return -1;
}
+base::ScopedFD GlobalDescriptors::TakeFD(
+ Key key,
+ base::MemoryMappedFile::Region* region) {
+ base::ScopedFD fd;
+ for (Mapping::iterator i = descriptors_.begin(); i != descriptors_.end();
+ ++i) {
+ if (i->key == key) {
+ *region = i->region;
+ fd.reset(i->fd);
+ descriptors_.erase(i);
+ break;
+ }
+ }
+ return fd;
+}
+
void GlobalDescriptors::Set(Key key, int fd) {
Set(key, fd, base::MemoryMappedFile::Region::kWholeFile);
}
« no previous file with comments | « base/posix/global_descriptors.h ('k') | content/app/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698