| 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 #ifndef CONTENT_COMMON_RESULT_CODES_H_ | 5 #ifndef CONTENT_COMMON_RESULT_CODES_H_ |
| 6 #define CONTENT_COMMON_RESULT_CODES_H_ | 6 #define CONTENT_COMMON_RESULT_CODES_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 | 10 |
| 11 // This file consolidates all the return codes for the browser and renderer | 11 // This file consolidates all the return codes for the browser and renderer |
| 12 // process. The return code is the value that: | 12 // process. The return code is the value that: |
| 13 // a) is returned by main() or winmain(), or | 13 // a) is returned by main() or winmain(), or |
| 14 // b) specified in the call for ExitProcess() or TerminateProcess(), or | 14 // b) specified in the call for ExitProcess() or TerminateProcess(), or |
| 15 // c) the exception value that causes a process to terminate. | 15 // c) the exception value that causes a process to terminate. |
| 16 // | 16 // |
| 17 // It is advisable to not use negative numbers because the Windows API returns | 17 // It is advisable to not use negative numbers because the Windows API returns |
| 18 // it as an unsigned long and the exception values have high numbers. For | 18 // it as an unsigned long and the exception values have high numbers. For |
| 19 // example EXCEPTION_ACCESS_VIOLATION value is 0xC0000005. | 19 // example EXCEPTION_ACCESS_VIOLATION value is 0xC0000005. |
| 20 | 20 |
| 21 class ResultCodes { | 21 namespace content { |
| 22 public: | |
| 23 enum ExitCode { | |
| 24 NORMAL_EXIT = 0, // Process terminated normally. | |
| 25 KILLED = 1, // Process was killed by user or system. | |
| 26 HUNG = 2, // Process hung. | |
| 27 INVALID_CMDLINE_URL, // An invalid command line url was given. | |
| 28 SBOX_INIT_FAILED, // The sandbox could not be initialized. | |
| 29 GOOGLE_UPDATE_INIT_FAILED, // The Google Update client stub init failed. | |
| 30 GOOGLE_UPDATE_LAUNCH_FAILED,// Google Update could not launch chrome DLL. | |
| 31 BAD_PROCESS_TYPE, // The process is of an unknown type. | |
| 32 MISSING_PATH, // An critical chrome path is missing. | |
| 33 MISSING_DATA, // A critical chrome file is missing. | |
| 34 SHELL_INTEGRATION_FAILED, // Failed to make Chrome default browser. | |
| 35 MACHINE_LEVEL_INSTALL_EXISTS, // Machine level install exists | |
| 36 UNINSTALL_DELETE_FILE_ERROR,// Error while deleting shortcuts. | |
| 37 UNINSTALL_CHROME_ALIVE, // Uninstall detected another chrome instance. | |
| 38 UNINSTALL_NO_SURVEY, // Do not launch survey after uninstall. | |
| 39 UNINSTALL_USER_CANCEL, // The user changed her mind. | |
| 40 UNINSTALL_DELETE_PROFILE, // Delete profile as well during uninstall. | |
| 41 UNSUPPORTED_PARAM, // Command line parameter is not supported. | |
| 42 KILLED_BAD_MESSAGE, // A bad message caused the process termination. | |
| 43 IMPORTER_HUNG, // Browser import hung and was killed. | |
| 44 RESPAWN_FAILED, // Trying to restart the browser we crashed. | |
| 45 | 22 |
| 46 NORMAL_EXIT_EXP1, // The EXP1, EXP2, EXP3, EXP4 are generic codes | 23 enum ResultCode { |
| 47 NORMAL_EXIT_EXP2, // used to communicate some simple outcome back | 24 // Process terminated normally. |
| 48 NORMAL_EXIT_EXP3, // to the process that launched us. This is | 25 RESULT_CODE_NORMAL_EXIT = 0, |
| 49 NORMAL_EXIT_EXP4, // used for experiments and the actual meaning | |
| 50 // depends on the experiment. | |
| 51 | 26 |
| 52 NORMAL_EXIT_CANCEL, // For experiments this return code means that | 27 // Process was killed by user or system. |
| 53 // the user canceled causes the did_run "dr" | 28 RESULT_CODE_KILLED = 1, |
| 54 // signal to be reset so this chrome run does | |
| 55 // not count as active chrome usage. | |
| 56 | 29 |
| 57 PROFILE_IN_USE, // The profile was in use on another host. | 30 // Process hung. |
| 31 RESULT_CODE_HUNG = 2, |
| 58 | 32 |
| 59 UNINSTALL_EXTENSION_ERROR, // Failed to silently uninstall an extension. | 33 // A bad message caused the process termination. |
| 60 PACK_EXTENSION_ERROR, // Failed to pack an extension via the cmd line. | 34 RESULT_CODE_KILLED_BAD_MESSAGE, |
| 61 | 35 |
| 62 EXIT_LAST_CODE // Last return code (keep it last). | 36 // Last return code (keep this last). |
| 63 }; | 37 RESULT_CODE_LAST_CODE |
| 64 }; | 38 }; |
| 65 | 39 |
| 40 } // namespace content |
| 41 |
| 66 #endif // CONTENT_COMMON_RESULT_CODES_H_ | 42 #endif // CONTENT_COMMON_RESULT_CODES_H_ |
| OLD | NEW |