| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ios/chrome/app/safe_mode_util.h" | 5 #include "ios/chrome/app/safe_mode_util.h" |
| 6 | 6 |
| 7 #include <mach-o/dyld.h> | 7 #include <mach-o/dyld.h> |
| 8 #include <stdint.h> |
| 8 | 9 |
| 9 namespace safe_mode_util { | 10 namespace safe_mode_util { |
| 10 | 11 |
| 11 std::vector<std::string> GetLoadedImages(const char* path_filter) { | 12 std::vector<std::string> GetLoadedImages(const char* path_filter) { |
| 12 std::vector<std::string> images; | 13 std::vector<std::string> images; |
| 13 uint32_t image_count = _dyld_image_count(); | 14 uint32_t image_count = _dyld_image_count(); |
| 14 for (uint32_t i = 0; i < image_count; ++i) { | 15 for (uint32_t i = 0; i < image_count; ++i) { |
| 15 const char* path = _dyld_get_image_name(i); | 16 const char* path = _dyld_get_image_name(i); |
| 16 if (path_filter && strncmp(path, path_filter, strlen(path_filter)) != 0) | 17 if (path_filter && strncmp(path, path_filter, strlen(path_filter)) != 0) |
| 17 continue; | 18 continue; |
| 18 images.push_back(path); | 19 images.push_back(path); |
| 19 } | 20 } |
| 20 return images; | 21 return images; |
| 21 } | 22 } |
| 22 | 23 |
| 23 } // namespace safe_mode_util | 24 } // namespace safe_mode_util |
| OLD | NEW |