| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GLOBAL_DESCRIPTORS_POSIX_H_ | 5 #ifndef BASE_GLOBAL_DESCRIPTORS_POSIX_H_ |
| 6 #define BASE_GLOBAL_DESCRIPTORS_POSIX_H_ | 6 #define BASE_GLOBAL_DESCRIPTORS_POSIX_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #include <vector> | 11 #include <vector> |
| 12 #include <utility> | 12 #include <utility> |
| 13 | 13 |
| 14 #include <stdint.h> | 14 #include <stdint.h> |
| 15 | 15 |
| 16 #include "base/singleton.h" | 16 #include "base/memory/singleton.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 | 19 |
| 20 // It's common practice to install file descriptors into well known slot | 20 // It's common practice to install file descriptors into well known slot |
| 21 // numbers before execing a child; stdin, stdout and stderr are ubiqutous | 21 // numbers before execing a child; stdin, stdout and stderr are ubiqutous |
| 22 // examples. | 22 // examples. |
| 23 // | 23 // |
| 24 // However, when using a zygote model, this becomes troublesome. Since the | 24 // However, when using a zygote model, this becomes troublesome. Since the |
| 25 // descriptors which need to be in these slots generally aren't known, any code | 25 // descriptors which need to be in these slots generally aren't known, any code |
| 26 // could open a resource and take one of the reserved descriptors. Simply | 26 // could open a resource and take one of the reserved descriptors. Simply |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 friend struct DefaultSingletonTraits<GlobalDescriptors>; | 61 friend struct DefaultSingletonTraits<GlobalDescriptors>; |
| 62 GlobalDescriptors(); | 62 GlobalDescriptors(); |
| 63 ~GlobalDescriptors(); | 63 ~GlobalDescriptors(); |
| 64 | 64 |
| 65 Mapping descriptors_; | 65 Mapping descriptors_; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace base | 68 } // namespace base |
| 69 | 69 |
| 70 #endif // BASE_GLOBAL_DESCRIPTORS_POSIX_H_ | 70 #endif // BASE_GLOBAL_DESCRIPTORS_POSIX_H_ |
| OLD | NEW |