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

Unified Diff: base/posix/global_descriptors.cc

Issue 2684433003: Files required by a service now listed in manifest. (Closed)
Patch Set: Removed unused method in apk_assets 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
Index: base/posix/global_descriptors.cc
diff --git a/base/posix/global_descriptors.cc b/base/posix/global_descriptors.cc
index 6c187838ad69d63051a1155d64c26623de8a2db0..1b5a33ec68d53813019999cc78a0d084c7e4ea9f 100644
--- a/base/posix/global_descriptors.cc
+++ b/base/posix/global_descriptors.cc
@@ -47,6 +47,23 @@ 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) {
+ if (region)
+ *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);
}

Powered by Google App Engine
This is Rietveld 408576698