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

Unified Diff: base/posix/global_descriptors.h

Issue 2549363004: Multiprocess test client: Android child process launcher rework. (Closed)
Patch Set: Addressed comments + synced Created 4 years 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.h
diff --git a/base/posix/global_descriptors.h b/base/posix/global_descriptors.h
index edb299de5c957cc36f5fbd0ae85a056051012ba9..198bf468524c6964963edff20f81c22a0ae13265 100644
--- a/base/posix/global_descriptors.h
+++ b/base/posix/global_descriptors.h
@@ -52,18 +52,7 @@ class BASE_EXPORT GlobalDescriptors {
// Often we want a canonical descriptor for a given Key. In this case, we add
// the following constant to the key value:
-#if !defined(OS_ANDROID)
static const int kBaseDescriptor = 3; // 0, 1, 2 are already taken.
-#else
- // 3 used by __android_log_write().
- // 4 used by... something important on Android M.
- // 5 used by... something important on Android L... on low-end devices.
- // TODO(amistry): An Android, this mechanism is only used for tests since the
- // content child launcher spawns a process by creating a new Activity using
- // the Android APIs. For tests, come up with a way that doesn't require using
- // a pre-defined fd.
- static const int kBaseDescriptor = 6;
-#endif
// Return the singleton instance of GlobalDescriptors.
static GlobalDescriptors* GetInstance();
@@ -84,6 +73,9 @@ class BASE_EXPORT GlobalDescriptors {
// Set the descriptor and |region| for the given |key|.
void Set(Key key, int fd, base::MemoryMappedFile::Region region);
+ // Generates a random key and uses it to set the descriptor.
Robert Sesek 2016/12/20 20:44:34 This seems like it could be confusing unless Regis
Jay Civelli 2016/12/20 23:07:26 What I don't like about the kBaseDescriptor+N appr
Robert Sesek 2016/12/21 19:26:07 I agree that this could start to become a problem
Jay Civelli 2016/12/21 22:26:22 Sounds good, now using a fixed key. I will try to
+ Key Register(int fd);
+
void Reset(const Mapping& mapping);
private:

Powered by Google App Engine
This is Rietveld 408576698