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 #import "chrome/browser/chrome_browser_application_mac.h" | 5 #import "chrome/browser/chrome_browser_application_mac.h" |
6 | 6 |
7 #import "base/logging.h" | 7 #import "base/logging.h" |
8 #import "base/mac/scoped_nsexception_enabler.h" | 8 #import "base/mac/scoped_nsexception_enabler.h" |
9 #import "base/metrics/histogram.h" | 9 #import "base/metrics/histogram.h" |
10 #import "base/memory/scoped_nsobject.h" | 10 #import "base/memory/scoped_nsobject.h" |
11 #import "base/sys_string_conversions.h" | 11 #import "base/sys_string_conversions.h" |
12 #import "chrome/app/breakpad_mac.h" | 12 #import "chrome/app/breakpad_mac.h" |
13 #import "chrome/browser/app_controller_mac.h" | 13 #import "chrome/browser/app_controller_mac.h" |
14 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
15 #import "chrome/browser/ui/cocoa/objc_method_swizzle.h" | |
16 #import "chrome/browser/ui/cocoa/objc_zombie.h" | |
17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 16 #import "chrome/common/mac/objc_method_swizzle.h" |
| 17 #import "chrome/common/mac/objc_zombie.h" |
18 #include "content/browser/accessibility/browser_accessibility_state.h" | 18 #include "content/browser/accessibility/browser_accessibility_state.h" |
19 #include "content/browser/renderer_host/render_view_host.h" | 19 #include "content/browser/renderer_host/render_view_host.h" |
20 | 20 |
21 // The implementation of NSExceptions break various assumptions in the | 21 // The implementation of NSExceptions break various assumptions in the |
22 // Chrome code. This category defines a replacement for | 22 // Chrome code. This category defines a replacement for |
23 // -initWithName:reason:userInfo: for purposes of forcing a break in | 23 // -initWithName:reason:userInfo: for purposes of forcing a break in |
24 // the debugger when an exception is raised. -raise sounds more | 24 // the debugger when an exception is raised. -raise sounds more |
25 // obvious to intercept, but it doesn't catch the original throw | 25 // obvious to intercept, but it doesn't catch the original throw |
26 // because the objc runtime doesn't use it. | 26 // because the objc runtime doesn't use it. |
27 @interface NSException (CrNSExceptionSwizzle) | 27 @interface NSException (CrNSExceptionSwizzle) |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 @selector(crInitWithName:reason:userInfo:)); | 203 @selector(crInitWithName:reason:userInfo:)); |
204 } | 204 } |
205 | 205 |
206 } // namespace | 206 } // namespace |
207 | 207 |
208 @implementation BrowserCrApplication | 208 @implementation BrowserCrApplication |
209 | 209 |
210 + (void)initialize { | 210 + (void)initialize { |
211 // Turn all deallocated Objective-C objects into zombies, keeping | 211 // Turn all deallocated Objective-C objects into zombies, keeping |
212 // the most recent 10,000 of them on the treadmill. | 212 // the most recent 10,000 of them on the treadmill. |
213 ObjcEvilDoers::ZombieEnable(YES, 10000); | 213 ObjcEvilDoers::ZombieEnable(true, 10000); |
214 } | 214 } |
215 | 215 |
216 - (id)init { | 216 - (id)init { |
217 SwizzleInit(); | 217 SwizzleInit(); |
218 return [super init]; | 218 return [super init]; |
219 } | 219 } |
220 | 220 |
221 //////////////////////////////////////////////////////////////////////////////// | 221 //////////////////////////////////////////////////////////////////////////////// |
222 // HISTORICAL COMMENT (by viettrungluu, from | 222 // HISTORICAL COMMENT (by viettrungluu, from |
223 // http://codereview.chromium.org/1520006 with mild editing): | 223 // http://codereview.chromium.org/1520006 with mild editing): |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 if (RenderViewHost* rvh = contents->render_view_host()) { | 429 if (RenderViewHost* rvh = contents->render_view_host()) { |
430 rvh->EnableRendererAccessibility(); | 430 rvh->EnableRendererAccessibility(); |
431 } | 431 } |
432 } | 432 } |
433 } | 433 } |
434 } | 434 } |
435 return [super accessibilitySetValue:value forAttribute:attribute]; | 435 return [super accessibilitySetValue:value forAttribute:attribute]; |
436 } | 436 } |
437 | 437 |
438 @end | 438 @end |
OLD | NEW |