OLD | NEW |
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 #import "chrome/common/mac/objc_zombie.h" | 5 #import "chrome/common/mac/objc_zombie.h" |
6 | 6 |
7 #include <AvailabilityMacros.h> | 7 #include <AvailabilityMacros.h> |
8 | 8 |
9 #include <execinfo.h> | 9 #include <execinfo.h> |
10 #import <objc/runtime.h> | 10 #import <objc/runtime.h> |
11 | 11 |
12 #include <algorithm> | 12 #include <algorithm> |
13 | 13 |
14 #include "base/debug/crash_logging.h" | 14 #include "base/debug/crash_logging.h" |
15 #include "base/debug/stack_trace.h" | 15 #include "base/debug/stack_trace.h" |
16 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/posix/eintr_wrapper.h" | 18 #include "base/posix/eintr_wrapper.h" |
19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
20 #include "base/synchronization/lock.h" | 20 #include "base/synchronization/lock.h" |
21 #include "chrome/common/crash_keys.h" | 21 #include "chrome/common/crash_keys.h" |
22 #import "chrome/common/mac/objc_method_swizzle.h" | |
23 | 22 |
24 #if !defined(OS_IOS) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_6) | 23 #if !defined(OS_IOS) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_6) |
25 // Apparently objc/runtime.h doesn't define this with the 10.6 SDK yet. | 24 // Apparently objc/runtime.h doesn't define this with the 10.6 SDK yet. |
26 // The docs say it exists since 10.6 however. | 25 // The docs say it exists since 10.6 however. |
27 OBJC_EXPORT void *objc_destructInstance(id obj); | 26 OBJC_EXPORT void *objc_destructInstance(id obj); |
28 #endif | 27 #endif |
29 | 28 |
30 // Deallocated objects are re-classed as |CrZombie|. No superclass | 29 // Deallocated objects are re-classed as |CrZombie|. No superclass |
31 // because then the class would have to override many/most of the | 30 // because then the class would have to override many/most of the |
32 // inherited methods (|NSObject| is like a category magnet!). | 31 // inherited methods (|NSObject| is like a category magnet!). |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 if (oldZombies) { | 424 if (oldZombies) { |
426 for (size_t i = 0; i < oldCount; ++i) { | 425 for (size_t i = 0; i < oldCount; ++i) { |
427 if (oldZombies[i].object) | 426 if (oldZombies[i].object) |
428 object_dispose(oldZombies[i].object); | 427 object_dispose(oldZombies[i].object); |
429 } | 428 } |
430 free(oldZombies); | 429 free(oldZombies); |
431 } | 430 } |
432 } | 431 } |
433 | 432 |
434 } // namespace ObjcEvilDoers | 433 } // namespace ObjcEvilDoers |
OLD | NEW |