Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: chrome/browser/chrome_browser_application_mac.mm

Issue 7826016: [Mac] Enable CrZombie for all processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace, and verify merge. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/chrome_main.cc ('k') | chrome/browser/ui/cocoa/objc_method_swizzle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/app/chrome_main.cc ('k') | chrome/browser/ui/cocoa/objc_method_swizzle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698