shrike | 2638281 | 2016-02-25 17:46:22 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_MAC_NSPROCESSINFO_ADDITIONS_H_ |
| 6 | #define CHROME_BROWSER_MAC_NSPROCESSINFO_ADDITIONS_H_ |
| 7 | |
| 8 | #import <Foundation/Foundation.h> |
| 9 | |
| 10 | @interface NSProcessInfo(ChromeAdditions) |
| 11 | // Returns YES if the current process is the main browser process or a test |
| 12 | // process. A better way is to check the command line directly (i.e. |
| 13 | // base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)), |
| 14 | // however that's not always possible, such as within a class's +load method. |
| 15 | // This method returns YES for test processes because it checks for the "type" |
| 16 | // switch on the command line, which test processes don't have. If your code |
| 17 | // should not run in a test process you will need to apply additional logic. |
| 18 | - (BOOL)cr_isMainBrowserOrTestProcess; |
| 19 | @end |
| 20 | |
| 21 | #endif // CHROME_BROWSER_MAC_NSPROCESSINFO_ADDITIONS_H_ |