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

Side by Side Diff: base/posix/global_descriptors.h

Issue 1952513003: Fix Android multi-process tests on M. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/test/multiprocess_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_POSIX_GLOBAL_DESCRIPTORS_H_ 5 #ifndef BASE_POSIX_GLOBAL_DESCRIPTORS_H_
6 #define BASE_POSIX_GLOBAL_DESCRIPTORS_H_ 6 #define BASE_POSIX_GLOBAL_DESCRIPTORS_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <vector> 10 #include <vector>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Optional region, defaults to kWholeFile. 48 // Optional region, defaults to kWholeFile.
49 base::MemoryMappedFile::Region region; 49 base::MemoryMappedFile::Region region;
50 }; 50 };
51 typedef std::vector<Descriptor> Mapping; 51 typedef std::vector<Descriptor> Mapping;
52 52
53 // Often we want a canonical descriptor for a given Key. In this case, we add 53 // Often we want a canonical descriptor for a given Key. In this case, we add
54 // the following constant to the key value: 54 // the following constant to the key value:
55 #if !defined(OS_ANDROID) 55 #if !defined(OS_ANDROID)
56 static const int kBaseDescriptor = 3; // 0, 1, 2 are already taken. 56 static const int kBaseDescriptor = 3; // 0, 1, 2 are already taken.
57 #else 57 #else
58 static const int kBaseDescriptor = 4; // 3 used by __android_log_write(). 58 // 3 used by __android_log_write().
59 // 4 used by... something important on Android M.
Mark Mentovai 2016/05/04 12:07:12 Wish we had more confidence in what this was. What
Anand Mistry (off Chromium) 2016/05/04 21:48:42 The problem I came across is that closing or dup'i
60 static const int kBaseDescriptor = 5;
59 #endif 61 #endif
60 62
61 // Return the singleton instance of GlobalDescriptors. 63 // Return the singleton instance of GlobalDescriptors.
62 static GlobalDescriptors* GetInstance(); 64 static GlobalDescriptors* GetInstance();
63 65
64 // Get a descriptor given a key. It is a fatal error if the key is not known. 66 // Get a descriptor given a key. It is a fatal error if the key is not known.
65 int Get(Key key) const; 67 int Get(Key key) const;
66 68
67 // Get a descriptor given a key. Returns -1 on error. 69 // Get a descriptor given a key. Returns -1 on error.
68 int MaybeGet(Key key) const; 70 int MaybeGet(Key key) const;
(...skipping 14 matching lines...) Expand all
83 friend struct DefaultSingletonTraits<GlobalDescriptors>; 85 friend struct DefaultSingletonTraits<GlobalDescriptors>;
84 GlobalDescriptors(); 86 GlobalDescriptors();
85 ~GlobalDescriptors(); 87 ~GlobalDescriptors();
86 88
87 Mapping descriptors_; 89 Mapping descriptors_;
88 }; 90 };
89 91
90 } // namespace base 92 } // namespace base
91 93
92 #endif // BASE_POSIX_GLOBAL_DESCRIPTORS_H_ 94 #endif // BASE_POSIX_GLOBAL_DESCRIPTORS_H_
OLDNEW
« no previous file with comments | « no previous file | base/test/multiprocess_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698