Index: base/file_descriptor_shuffle.h |
diff --git a/base/file_descriptor_shuffle.h b/base/file_descriptor_shuffle.h |
index e0cb88b8552b39dac9abe1bd86b178e3690b07de..e1c93cd3d45e2bc4ccb95e13a8dcb74547a001d6 100644 |
--- a/base/file_descriptor_shuffle.h |
+++ b/base/file_descriptor_shuffle.h |
@@ -69,9 +69,13 @@ typedef std::vector<InjectionArc> InjectiveMultimap; |
bool PerformInjectiveMultimap(const InjectiveMultimap& map, |
InjectionDelegate* delegate); |
-static inline bool ShuffleFileDescriptors(const InjectiveMultimap& map) { |
+bool PerformInjectiveMultimapDestructive(InjectiveMultimap* map, |
+ InjectionDelegate* delegate); |
+ |
+// This function will not call malloc but will mutate |map| |
+static inline bool ShuffleFileDescriptors(InjectiveMultimap* map) { |
FileDescriptorTableInjection delegate; |
- return PerformInjectiveMultimap(map, &delegate); |
+ return PerformInjectiveMultimapDestructive(map, &delegate); |
} |
} // namespace base |