diff options
38 files changed, 201 insertions, 140 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc index f2b29ad..d47c99e 100644 --- a/chrome/app/breakpad_win.cc +++ b/chrome/app/breakpad_win.cc @@ -25,12 +25,12 @@ #include "breakpad/src/client/windows/handler/exception_handler.h" #include "chrome/app/hard_error_handler_win.h" #include "chrome/common/child_process_logging.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/env_vars.h" #include "chrome/installer/util/google_chrome_sxs_distribution.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/install_util.h" -#include "content/common/result_codes.h" #include "policy/policy_constants.h" namespace { @@ -396,7 +396,7 @@ bool WrapMessageBoxWithSEH(const wchar_t* text, const wchar_t* caption, *exit_now = (IDOK != ::MessageBoxW(NULL, text, caption, flags)); } __except(EXCEPTION_EXECUTE_HANDLER) { // Its not safe to continue executing, exit silently here. - ::ExitProcess(ResultCodes::RESPAWN_FAILED); + ::ExitProcess(chrome::RESULT_CODE_RESPAWN_FAILED); } return true; @@ -445,7 +445,7 @@ extern "C" int __declspec(dllexport) CrashForException( EXCEPTION_POINTERS* info) { if (g_breakpad) { g_breakpad->WriteMinidumpForException(info); - ::ExitProcess(ResultCodes::KILLED); + ::ExitProcess(content::RESULT_CODE_KILLED); } return EXCEPTION_CONTINUE_SEARCH; } diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc index 28c0da4..f1f54eb 100644 --- a/chrome/app/chrome_exe_main_win.cc +++ b/chrome/app/chrome_exe_main_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -25,7 +25,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { // We restarted because of a previous crash. Ask user if we should relaunch. if (ShowRestartDialogIfCrashed(&exit_now)) { if (exit_now) - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; } // Initialize the commandline singleton from the environment. diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index aa15181..dc6ddd0 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -18,6 +18,7 @@ #include "chrome/app/breakpad_win.h" #include "chrome/app/client_util.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/common/chrome_switches.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/channel_info.h" @@ -25,7 +26,6 @@ #include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/util_constants.h" -#include "content/common/result_codes.h" namespace { // The entry point signature of chrome.dll. @@ -238,7 +238,7 @@ int MainDllLoader::Launch(HINSTANCE instance, std::wstring file; dll_ = Load(&version, &file); if (!dll_) - return ResultCodes::MISSING_DATA; + return chrome::RESULT_CODE_MISSING_DATA; scoped_ptr<base::Environment> env(base::Environment::Create()); env->SetVar(chrome::kChromeVersionEnvVar, WideToUTF8(version)); @@ -249,7 +249,7 @@ int MainDllLoader::Launch(HINSTANCE instance, DLL_MAIN entry_point = reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll_, "ChromeMain")); if (!entry_point) - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; int rc = entry_point(instance, sbox_info, ::GetCommandLineW()); return OnBeforeExit(rc, file); @@ -287,7 +287,7 @@ class ChromeDllLoader : public MainDllLoader { // NORMAL_EXIT_CANCEL is used for experiments when the user cancels // so we need to reset the did_run signal so omaha does not count // this run as active usage. - if (ResultCodes::NORMAL_EXIT_CANCEL == return_code) { + if (content::RESULT_CODE_NORMAL_EXIT_CANCEL == return_code) { ClearDidRun(dll_path); } return return_code; diff --git a/chrome/app/dummy_main_functions.cc b/chrome/app/dummy_main_functions.cc index f3b4a61..79dbd6c 100644 --- a/chrome/app/dummy_main_functions.cc +++ b/chrome/app/dummy_main_functions.cc @@ -8,39 +8,39 @@ // Native Client binary for 64-bit Windows can run only the NaCl loader or // the sandbox broker processes. Other process types are not supported. int BrowserMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int RendererMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int PluginMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int PpapiPluginMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int PpapiBrokerMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int WorkerMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int UtilityMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int ProfileImportMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int ZygoteMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int DiagnosticsMain(const CommandLine& command_line) { @@ -48,9 +48,9 @@ int DiagnosticsMain(const CommandLine& command_line) { } int GpuMain(const MainFunctionParams&) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } int ServiceProcessMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return content::RESULT_CODE_BAD_PROCESS_TYPE; } diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 78d5ab4..e8232d7 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -78,6 +78,7 @@ #include "chrome/browser/web_resource/gpu_blacklist_updater.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/env_vars.h" @@ -94,7 +95,6 @@ #include "content/common/content_client.h" #include "content/common/hi_res_timer_manager.h" #include "content/common/main_function_params.h" -#include "content/common/result_codes.h" #include "grit/app_locale_settings.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -1428,12 +1428,12 @@ int BrowserMain(const MainFunctionParams& parameters) { TryChromeDialogView::Result answer = TryChromeDialogView::Show(try_chrome_int, &process_singleton); if (answer == TryChromeDialogView::NOT_NOW) - return ResultCodes::NORMAL_EXIT_CANCEL; + return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; if (answer == TryChromeDialogView::UNINSTALL_CHROME) - return ResultCodes::NORMAL_EXIT_EXP2; + return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; #else // We don't support retention experiments on Mac or Linux. - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; #endif // defined(OS_WIN) } @@ -1564,7 +1564,8 @@ int BrowserMain(const MainFunctionParams& parameters) { return HandleIconsCommands(parsed_command_line); if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { return ShellIntegration::SetAsDefaultBrowser() ? - ResultCodes::NORMAL_EXIT : ResultCodes::SHELL_INTEGRATION_FAILED; + static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) : + static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); } // If the command line specifies --pack-extension, attempt the pack extension @@ -1572,9 +1573,9 @@ int BrowserMain(const MainFunctionParams& parameters) { if (parsed_command_line.HasSwitch(switches::kPackExtension)) { ExtensionsStartupUtil extension_startup_util; if (extension_startup_util.PackExtension(parsed_command_line)) { - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; } else { - return ResultCodes::PACK_EXTENSION_ERROR; + return chrome::RESULT_CODE_PACK_EXTENSION_ERROR; } } @@ -1600,10 +1601,10 @@ int BrowserMain(const MainFunctionParams& parameters) { printf("%s\n", base::SysWideToNativeMB(UTF16ToWide( l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); #endif - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; case ProcessSingleton::PROFILE_IN_USE: - return ResultCodes::PROFILE_IN_USE; + return chrome::RESULT_CODE_PROFILE_IN_USE; case ProcessSingleton::LOCK_ERROR: LOG(ERROR) << "Failed to create a ProcessSingleton for your profile " @@ -1611,7 +1612,7 @@ int BrowserMain(const MainFunctionParams& parameters) { "would start multiple browser processes rather than " "opening a new window in the existing process. Aborting " "now to avoid profile corruption."; - return ResultCodes::PROFILE_IN_USE; + return chrome::RESULT_CODE_PROFILE_IN_USE; default: NOTREACHED(); @@ -1659,7 +1660,7 @@ int BrowserMain(const MainFunctionParams& parameters) { Profile* profile = CreateProfile(parameters, user_data_dir); if (!profile) - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; // Post-profile init --------------------------------------------------------- @@ -1701,7 +1702,7 @@ int BrowserMain(const MainFunctionParams& parameters) { #if defined(OS_WIN) // Do the tasks if chrome has been upgraded while it was last running. if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line)) - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; #endif // Check if there is any machine level Chrome installed on the current @@ -1714,7 +1715,7 @@ int BrowserMain(const MainFunctionParams& parameters) { // Do not allow this to occur for Chrome Frame user-to-system handoffs. if (!parsed_command_line.HasSwitch(switches::kChromeFrame) && CheckMachineLevelInstall()) - return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; + return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS; // Create the TranslateManager singleton. TranslateManager* translate_manager = TranslateManager::GetInstance(); @@ -1727,7 +1728,7 @@ int BrowserMain(const MainFunctionParams& parameters) { if (MaybeInstallFromDiskImage()) { // The application was installed and the installed copy has been // launched. This process is now obsolete. Exit. - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; } } #endif @@ -1919,9 +1920,9 @@ int BrowserMain(const MainFunctionParams& parameters) { if (parsed_command_line.HasSwitch(switches::kUninstallExtension)) { ExtensionsStartupUtil ext_startup_util; if (ext_startup_util.UninstallExtension(parsed_command_line, profile)) { - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; } else { - return ResultCodes::UNINSTALL_EXTENSION_ERROR; + return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR; } } @@ -1966,7 +1967,7 @@ int BrowserMain(const MainFunctionParams& parameters) { // Start watching all browser threads for responsiveness. ThreadWatcherList::StartWatchingAll(parsed_command_line); - int result_code = ResultCodes::NORMAL_EXIT; + int result_code = content::RESULT_CODE_NORMAL_EXIT; if (parameters.ui_task) { // We are in test mode. Run one task and enter the main message loop. if (pool) diff --git a/chrome/browser/browser_main_gtk.cc b/chrome/browser/browser_main_gtk.cc index 3701a57..98480e0 100644 --- a/chrome/browser/browser_main_gtk.cc +++ b/chrome/browser/browser_main_gtk.cc @@ -15,9 +15,9 @@ #include "chrome/browser/metrics/metrics_service.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/chrome_result_codes.h" #include "content/browser/renderer_host/render_sandbox_host_linux.h" #include "content/browser/zygote_host_linux.h" -#include "content/common/result_codes.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -186,7 +186,7 @@ void RecordBrowserStartupTime() { // From browser_main_win.h, stubs until we figure out the right thing... int DoUninstallTasks(bool chrome_still_running) { - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; } int HandleIconsCommands(const CommandLine &parsed_command_line) { diff --git a/chrome/browser/browser_main_mac.mm b/chrome/browser/browser_main_mac.mm index c5e9ab5..4e91371 100644 --- a/chrome/browser/browser_main_mac.mm +++ b/chrome/browser/browser_main_mac.mm @@ -48,7 +48,7 @@ void WarnAboutMinimumSystemRequirements() { // From browser_main_win.h, stubs until we figure out the right thing... int DoUninstallTasks(bool chrome_still_running) { - return ResultCodes::NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; } int HandleIconsCommands(const CommandLine& parsed_command_line) { diff --git a/chrome/browser/browser_main_win.cc b/chrome/browser/browser_main_win.cc index 3611b21..0f52bea 100644 --- a/chrome/browser/browser_main_win.cc +++ b/chrome/browser/browser_main_win.cc @@ -25,6 +25,7 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/views/uninstall_view.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/env_vars.h" #include "chrome/installer/util/browser_distribution.h" @@ -32,7 +33,6 @@ #include "chrome/installer/util/install_util.h" #include "chrome/installer/util/shell_util.h" #include "content/common/main_function_params.h" -#include "content/common/result_codes.h" #include "crypto/nss_util.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -99,7 +99,7 @@ void RecordBrowserStartupTime() { } int AskForUninstallConfirmation() { - int ret = ResultCodes::NORMAL_EXIT; + int ret = content::RESULT_CODE_NORMAL_EXIT; views::Widget::CreateWindow(new UninstallView(ret))->Show(); views::AcceleratorHandler accelerator_handler; MessageLoopForUI::current()->Run(&accelerator_handler); @@ -120,15 +120,15 @@ int DoUninstallTasks(bool chrome_still_running) { // check once again after user acknowledges Uninstall dialog. if (chrome_still_running) { ShowCloseBrowserFirstMessageBox(); - return ResultCodes::UNINSTALL_CHROME_ALIVE; + return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; } int ret = AskForUninstallConfirmation(); if (browser_util::IsBrowserAlreadyRunning()) { ShowCloseBrowserFirstMessageBox(); - return ResultCodes::UNINSTALL_CHROME_ALIVE; + return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; } - if (ret != ResultCodes::UNINSTALL_USER_CANCEL) { + if (ret != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { // The following actions are just best effort. VLOG(1) << "Executing uninstall actions"; if (!FirstRun::RemoveSentinel()) @@ -225,7 +225,7 @@ int HandleIconsCommands(const CommandLine& parsed_command_line) { } else if (version >= base::win::VERSION_XP) { cp_applet.assign(L"Add/Remove Programs"); // Windows XP. } else { - return ResultCodes::UNSUPPORTED_PARAM; // Not supported + return chrome::RESULT_CODE_UNSUPPORTED_PARAM; // Not supported } const string16 msg = @@ -234,10 +234,12 @@ int HandleIconsCommands(const CommandLine& parsed_command_line) { const UINT flags = MB_OKCANCEL | MB_ICONWARNING | MB_TOPMOST; if (IDOK == ui::MessageBox(NULL, msg, caption, flags)) ShellExecute(NULL, NULL, L"appwiz.cpl", NULL, NULL, SW_SHOWNORMAL); - return ResultCodes::NORMAL_EXIT; // Exit as we are not launching browser. + + // Exit as we are not launching the browser. + return content::RESULT_CODE_NORMAL_EXIT; } // We don't hide icons so we shouldn't do anything special to show them - return ResultCodes::UNSUPPORTED_PARAM; + return chrome::RESULT_CODE_UNSUPPORTED_PARAM; } // Check if there is any machine level Chrome installed on the current diff --git a/chrome/browser/extensions/extension_crash_recovery_browsertest.cc b/chrome/browser/extensions/extension_crash_recovery_browsertest.cc index b6e9db1..c325afa 100644 --- a/chrome/browser/extensions/extension_crash_recovery_browsertest.cc +++ b/chrome/browser/extensions/extension_crash_recovery_browsertest.cc @@ -73,7 +73,8 @@ class ExtensionCrashRecoveryTest : public ExtensionBrowserTest { RenderProcessHost* extension_rph = extension_host->render_view_host()->process(); - base::KillProcess(extension_rph->GetHandle(), ResultCodes::KILLED, false); + base::KillProcess(extension_rph->GetHandle(), content::RESULT_CODE_KILLED, + false); ASSERT_TRUE(WaitForExtensionCrash(extension_id)); ASSERT_FALSE( GetExtensionProcessManager()->GetBackgroundHostForExtension(extension)); diff --git a/chrome/browser/extensions/extension_function.cc b/chrome/browser/extensions/extension_function.cc index 5b814fd..0374dd0 100644 --- a/chrome/browser/extensions/extension_function.cc +++ b/chrome/browser/extensions/extension_function.cc @@ -112,7 +112,8 @@ void ExtensionFunction::HandleBadMessage(base::ProcessHandle process) { NOTREACHED(); UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_EFD")); if (process) - base::KillProcess(process, ResultCodes::KILLED_BAD_MESSAGE, false); + base::KillProcess(process, content::RESULT_CODE_KILLED_BAD_MESSAGE, + false); } } UIThreadExtensionFunction::UIThreadExtensionFunction() diff --git a/chrome/browser/first_run/first_run_import_observer.cc b/chrome/browser/first_run/first_run_import_observer.cc index b82205c..0e07390 100644 --- a/chrome/browser/first_run/first_run_import_observer.cc +++ b/chrome/browser/first_run/first_run_import_observer.cc @@ -8,7 +8,7 @@ #include "content/common/result_codes.h" FirstRunImportObserver::FirstRunImportObserver() - : loop_running_(false), import_result_(ResultCodes::NORMAL_EXIT) { + : loop_running_(false), import_result_(content::RESULT_CODE_NORMAL_EXIT) { } FirstRunImportObserver::~FirstRunImportObserver() { @@ -25,6 +25,6 @@ void FirstRunImportObserver::Finish() { } void FirstRunImportObserver::ImportCompleted() { - import_result_ = ResultCodes::NORMAL_EXIT; + import_result_ = content::RESULT_CODE_NORMAL_EXIT; Finish(); } diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc index 2a62ad7..d4c91ceb 100644 --- a/chrome/browser/first_run/first_run_win.cc +++ b/chrome/browser/first_run/first_run_win.cc @@ -28,6 +28,7 @@ #include "chrome/browser/importer/importer_progress_dialog.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_notification_types.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/worker_thread_ticker.h" #include "chrome/installer/util/browser_distribution.h" @@ -38,7 +39,6 @@ #include "chrome/installer/util/util_constants.h" #include "content/browser/user_metrics.h" #include "content/common/notification_service.h" -#include "content/common/result_codes.h" #include "google_update_idl.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -184,7 +184,7 @@ class ImportProcessRunner : public base::win::ObjectWatcher::Delegate { // the import_process handle. explicit ImportProcessRunner(base::ProcessHandle import_process) : import_process_(import_process), - exit_code_(ResultCodes::NORMAL_EXIT) { + exit_code_(content::RESULT_CODE_NORMAL_EXIT) { watcher_.StartWatching(import_process, this); MessageLoop::current()->Run(); } @@ -246,7 +246,7 @@ class HungImporterMonitor : public WorkerThreadTicker::Callback { // while the other process still not pumping messages. HWND active_window = ::GetLastActivePopup(owner_window_); if (::IsHungAppWindow(active_window) || ::IsHungAppWindow(owner_window_)) { - ::TerminateProcess(import_process_, ResultCodes::IMPORTER_HUNG); + ::TerminateProcess(import_process_, chrome::RESULT_CODE_IMPORTER_HUNG); import_process_ = NULL; } } @@ -356,7 +356,7 @@ bool FirstRun::ImportSettings(Profile* profile, if (profile) profile->GetPrefs()->ReloadPersistentPrefs(); - return (import_runner.exit_code() == ResultCodes::NORMAL_EXIT); + return (import_runner.exit_code() == content::RESULT_CODE_NORMAL_EXIT); } // static diff --git a/chrome/browser/hang_monitor/hung_window_detector.cc b/chrome/browser/hang_monitor/hung_window_detector.cc index 39bedc6..035f270 100644 --- a/chrome/browser/hang_monitor/hung_window_detector.cc +++ b/chrome/browser/hang_monitor/hung_window_detector.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -148,7 +148,7 @@ bool HungWindowDetector::CheckChildWindow(HWND child_window) { if (process_id_check != child_window_process_id) { break; } - TerminateProcess(child_process, ResultCodes::HUNG); + TerminateProcess(child_process, content::RESULT_CODE_HUNG); WaitForSingleObject(child_process, kTerminateTimeout); child_process.Close(); break; diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc index b21610e..49a245a 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc @@ -155,7 +155,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() { } // Time to take action. Kill the browser process. - base::KillProcessById(process_id, ResultCodes::HUNG, true); + base::KillProcessById(process_id, content::RESULT_CODE_HUNG, true); remote_window_ = NULL; return PROCESS_NONE; } diff --git a/chrome/browser/renderer_host/web_cache_manager_browsertest.cc b/chrome/browser/renderer_host/web_cache_manager_browsertest.cc index b2e8471..235dc3d 100644 --- a/chrome/browser/renderer_host/web_cache_manager_browsertest.cc +++ b/chrome/browser/renderer_host/web_cache_manager_browsertest.cc @@ -34,7 +34,7 @@ IN_PROC_BROWSER_TEST_F(WebCacheManagerBrowserTest, DISABLED_CrashOnceOnly) { TabContents* tab = browser()->GetTabContentsAt(0); ASSERT_TRUE(tab != NULL); base::KillProcess(tab->GetRenderProcessHost()->GetHandle(), - ResultCodes::KILLED, true); + content::RESULT_CODE_KILLED, true); browser()->ActivateTabAt(0, true); browser()->NewTab(); diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc index 0e64113dd..0f2703b 100644 --- a/chrome/browser/task_manager/task_manager.cc +++ b/chrome/browser/task_manager/task_manager.cc @@ -957,7 +957,7 @@ void TaskManager::KillProcess(int index) { base::ProcessHandle process = model_->GetResourceProcessHandle(index); DCHECK(process); if (process != base::GetCurrentProcessHandle()) - base::KillProcess(process, ResultCodes::KILLED, false); + base::KillProcess(process, content::RESULT_CODE_KILLED, false); } void TaskManager::ActivateProcess(int index) { diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index fd6bbd5..1060eb5 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -54,6 +54,7 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/pref_names.h" @@ -64,7 +65,6 @@ #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents_view.h" -#include "content/common/result_codes.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -550,7 +550,7 @@ bool BrowserInit::LaunchBrowser(const CommandLine& command_line, if (!launched) { LOG(ERROR) << "launch error"; if (return_code) - *return_code = ResultCodes::INVALID_CMDLINE_URL; + *return_code = chrome::RESULT_CODE_INVALID_CMDLINE_URL; return false; } diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc index 48a5d1b..ac7aa30 100644 --- a/chrome/browser/ui/browser_list.cc +++ b/chrome/browser/ui/browser_list.cc @@ -538,9 +538,9 @@ void BrowserList::SessionEnding() { #if defined(OS_WIN) // At this point the message loop is still running yet we've shut everything // down. If any messages are processed we'll likely crash. Exit now. - ExitProcess(ResultCodes::NORMAL_EXIT); + ExitProcess(content::RESULT_CODE_NORMAL_EXIT); #elif defined(OS_POSIX) && !defined(OS_MACOSX) - _exit(ResultCodes::NORMAL_EXIT); + _exit(content::RESULT_CODE_NORMAL_EXIT); #else NOTIMPLEMENTED(); #endif diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.mm b/chrome/browser/ui/cocoa/hung_renderer_controller.mm index bbd0a60..f8dc950 100644 --- a/chrome/browser/ui/cocoa/hung_renderer_controller.mm +++ b/chrome/browser/ui/cocoa/hung_renderer_controller.mm @@ -86,7 +86,7 @@ HungRendererController* g_instance = NULL; - (IBAction)kill:(id)sender { if (hungContents_) base::KillProcess(hungContents_->GetRenderProcessHost()->GetHandle(), - ResultCodes::HUNG, false); + content::RESULT_CODE_HUNG, false); // Cannot call performClose:, because the close button is disabled. [self close]; } diff --git a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc index e4eecde..a8d9910 100644 --- a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc @@ -194,7 +194,7 @@ void HungRendererDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { // Kill the process. if (contents_ && contents_->GetRenderProcessHost()) { base::KillProcess(contents_->GetRenderProcessHost()->GetHandle(), - ResultCodes::HUNG, false); + content::RESULT_CODE_HUNG, false); } break; diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index 117e86c..0a55287 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc @@ -339,7 +339,7 @@ void HungRendererDialogView::ButtonPressed( if (contents_ && contents_->GetRenderProcessHost()) { // Kill the process. TerminateProcess(contents_->GetRenderProcessHost()->GetHandle(), - ResultCodes::HUNG); + content::RESULT_CODE_HUNG); } } } diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc index f0a9928..1e80a3b 100644 --- a/chrome/browser/ui/views/uninstall_view.cc +++ b/chrome/browser/ui/views/uninstall_view.cc @@ -9,9 +9,9 @@ #include "base/string16.h" #include "base/utf_string_conversions.h" #include "chrome/browser/shell_integration.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/shell_util.h" -#include "content/common/result_codes.h" #include "grit/chromium_strings.h" #include "ui/base/l10n/l10n_util.h" #include "views/controls/button/checkbox.h" @@ -97,9 +97,9 @@ void UninstallView::SetupControls() { } bool UninstallView::Accept() { - user_selection_ = ResultCodes::NORMAL_EXIT; + user_selection_ = content::RESULT_CODE_NORMAL_EXIT; if (delete_profile_->checked()) - user_selection_ = ResultCodes::UNINSTALL_DELETE_PROFILE; + user_selection_ = chrome::RESULT_CODE_UNINSTALL_DELETE_PROFILE; if (change_default_browser_ && change_default_browser_->checked()) { int index = browsers_combo_->selected_item(); BrowsersMap::const_iterator it = browsers_->begin(); @@ -110,7 +110,7 @@ bool UninstallView::Accept() { } bool UninstallView::Cancel() { - user_selection_ = ResultCodes::UNINSTALL_USER_CANCEL; + user_selection_ = chrome::RESULT_CODE_UNINSTALL_USER_CANCEL; return true; } diff --git a/chrome/common/chrome_result_codes.h b/chrome/common/chrome_result_codes.h new file mode 100644 index 0000000..b380851 --- /dev/null +++ b/chrome/common/chrome_result_codes.h @@ -0,0 +1,78 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_COMMON_CHROME_RESULT_CODES_H_ +#define CHROME_COMMON_CHROME_RESULT_CODES_H_ +#pragma once + +#include "content/common/result_codes.h" + +namespace chrome { + +enum ResultCode { + RESULT_CODE_CHROME_START = content::RESULT_CODE_LAST_CODE, + + // An invalid command line url was given. + RESULT_CODE_INVALID_CMDLINE_URL = RESULT_CODE_CHROME_START, + + // The process is of an unknown type. + RESULT_CODE_BAD_PROCESS_TYPE, + + // A critical chrome file is missing. + RESULT_CODE_MISSING_DATA, + + // Failed to make Chrome default browser (not used?). + RESULT_CODE_SHELL_INTEGRATION_FAILED, + + // Machine level install exists + RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS, + + // Uninstall detected another chrome instance. + RESULT_CODE_UNINSTALL_CHROME_ALIVE, + + // The user changed their mind. + RESULT_CODE_UNINSTALL_USER_CANCEL, + + // Delete profile as well during uninstall. + RESULT_CODE_UNINSTALL_DELETE_PROFILE, + + // Command line parameter is not supported. + RESULT_CODE_UNSUPPORTED_PARAM, + + // Browser import hung and was killed. + RESULT_CODE_IMPORTER_HUNG, + + // Trying to restart the browser we crashed. + RESULT_CODE_RESPAWN_FAILED, + + // The EXP1, EXP2, EXP3, EXP4 are generic codes used to communicate some + // simple outcome back to the process that launched us. This is used for + // experiments and the actual meaning depends on the experiment. + // (only EXP2 is used?) + RESULT_CODE_NORMAL_EXIT_EXP1, + RESULT_CODE_NORMAL_EXIT_EXP2, + RESULT_CODE_NORMAL_EXIT_EXP3, + RESULT_CODE_NORMAL_EXIT_EXP4, + + // For experiments this return code means that the user canceled causes the + // did_run "dr" signal to be reset soi this chrome run does not count as + // active chrome usage. + RESULT_CODE_NORMAL_EXIT_CANCEL, + + // The profile was in use on another host. + RESULT_CODE_PROFILE_IN_USE, + + // Failed to pack an extension via the cmd line. + RESULT_CODE_PACK_EXTENSION_ERROR, + + // Failed to silently uninstall an extension. + RESULT_CODE_UNINSTALL_EXTENSION_ERROR, + + // Last return code (keep this last). + RESULT_CODE_CHROME_LAST_CODE, +}; + +} // namespace chrome + +#endif // CHROME_COMMON_CHROME_RESULT_CODES_H_ diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 56f2bdd..77ca61e 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -16,6 +16,7 @@ #include "base/win/windows_version.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths_internal.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/installer/setup/install.h" #include "chrome/installer/setup/install_worker.h" #include "chrome/installer/setup/setup_constants.h" @@ -32,7 +33,6 @@ #include "chrome/installer/util/self_cleaning_temp_dir.h" #include "chrome/installer/util/shell_util.h" #include "chrome/installer/util/util_constants.h" -#include "content/common/result_codes.h" #include "rlz/win/lib/rlz_lib.h" // Build-time generated include file. @@ -138,9 +138,9 @@ void CloseAllChromeProcesses() { if (!SendMessageTimeout(tmpWnd, WM_CLOSE, 0, 0, SMTO_BLOCK, 3000, NULL) && (GetLastError() == ERROR_TIMEOUT)) { base::CleanupProcesses(installer::kChromeExe, 0, - ResultCodes::HUNG, NULL); + content::RESULT_CODE_HUNG, NULL); base::CleanupProcesses(installer::kNaClExe, 0, - ResultCodes::HUNG, NULL); + content::RESULT_CODE_HUNG, NULL); return; } } @@ -150,9 +150,9 @@ void CloseAllChromeProcesses() { // chrome.exe. This check is just in case Chrome is ignoring WM_CLOSE // messages. base::CleanupProcesses(installer::kChromeExe, 15000, - ResultCodes::HUNG, NULL); + content::RESULT_CODE_HUNG, NULL); base::CleanupProcesses(installer::kNaClExe, 15000, - ResultCodes::HUNG, NULL); + content::RESULT_CODE_HUNG, NULL); } // Attempts to close the Chrome Frame helper process by sending WM_CLOSE @@ -187,7 +187,7 @@ void CloseChromeFrameHelperProcess() { if (kill) { VLOG(1) << installer::kChromeFrameHelperExe << " hung. Killing."; base::CleanupProcesses(installer::kChromeFrameHelperExe, 0, - ResultCodes::HUNG, NULL); + content::RESULT_CODE_HUNG, NULL); } } @@ -440,7 +440,7 @@ DeleteResult DeleteFilesAndFolders(const InstallerState& installer_state, InstallStatus IsChromeActiveOrUserCancelled( const InstallerState& installer_state, const Product& product) { - int32 exit_code = ResultCodes::NORMAL_EXIT; + int32 exit_code = content::RESULT_CODE_NORMAL_EXIT; CommandLine options(CommandLine::NO_PROGRAM); options.AppendSwitch(installer::switches::kUninstall); @@ -457,12 +457,12 @@ InstallStatus IsChromeActiveOrUserCancelled( &exit_code)) { VLOG(1) << "chrome.exe launched for uninstall confirmation returned: " << exit_code; - if ((exit_code == ResultCodes::UNINSTALL_CHROME_ALIVE) || - (exit_code == ResultCodes::UNINSTALL_USER_CANCEL) || - (exit_code == ResultCodes::HUNG)) + if ((exit_code == chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE) || + (exit_code == chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) || + (exit_code == chrome::RESULT_CODE_HUNG)) return installer::UNINSTALL_CANCELLED; - if (exit_code == ResultCodes::UNINSTALL_DELETE_PROFILE) + if (exit_code == chrome::RESULT_CODE_UNINSTALL_DELETE_PROFILE) return installer::UNINSTALL_DELETE_PROFILE; } else { PLOG(ERROR) << "Failed to launch chrome.exe for uninstall confirmation."; diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc index 11d2128..dc1c835 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -24,6 +24,7 @@ #include "base/win/registry.h" #include "base/win/windows_version.h" #include "chrome/common/attrition_experiments.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/installer/util/channel_info.h" @@ -36,7 +37,6 @@ #include "chrome/installer/util/util_constants.h" #include "chrome/installer/util/wmi.h" #include "content/common/json_value_serializer.h" -#include "content/common/result_codes.h" #include "installer_util_strings.h" // NOLINT @@ -776,13 +776,13 @@ void GoogleChromeDistribution::InactiveUserToastExperiment(int flavor, // The chrome process has exited, figure out what happened. const wchar_t* outcome = NULL; switch (exit_code) { - case ResultCodes::NORMAL_EXIT: + case content::RESULT_CODE_NORMAL_EXIT: outcome = kToastExpTriesOkGroup; break; - case ResultCodes::NORMAL_EXIT_CANCEL: + case chrome::RESULT_CODE_NORMAL_EXIT_CANCEL: outcome = kToastExpCancelGroup; break; - case ResultCodes::NORMAL_EXIT_EXP2: + case chrome::RESULT_CODE_NORMAL_EXIT_EXP2: outcome = kToastExpUninstallGroup; break; default: diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc index 64adb2c..6d882d3 100644 --- a/chrome/nacl/nacl_main.cc +++ b/chrome/nacl/nacl_main.cc @@ -13,6 +13,7 @@ #include "base/string_util.h" #include "base/system_monitor/system_monitor.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_result_codes.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "chrome/nacl/nacl_launcher_thread.h" @@ -20,7 +21,6 @@ #include "content/common/child_process.h" #include "content/common/hi_res_timer_manager.h" #include "content/common/main_function_params.h" -#include "content/common/result_codes.h" #include "content/common/sandbox_policy.h" #if defined(OS_WIN) @@ -75,7 +75,7 @@ int NaClBrokerMain(const MainFunctionParams& parameters) { } #else int NaClBrokerMain(const MainFunctionParams& parameters) { - return ResultCodes::BAD_PROCESS_TYPE; + return chrome::RESULT_CODE_BAD_PROCESS_TYPE; } #endif // _WIN64 diff --git a/chrome/service/service_child_process_host.cc b/chrome/service/service_child_process_host.cc index d111e90..e25dd59 100644 --- a/chrome/service/service_child_process_host.cc +++ b/chrome/service/service_child_process_host.cc @@ -21,7 +21,7 @@ ServiceChildProcessHost::ServiceChildProcessHost(ProcessType type) ServiceChildProcessHost::~ServiceChildProcessHost() { // We need to kill the child process when the host dies. - base::KillProcess(handle(), ResultCodes::NORMAL_EXIT, false); + base::KillProcess(handle(), content::RESULT_CODE_NORMAL_EXIT, false); } bool ServiceChildProcessHost::Launch(CommandLine* cmd_line, diff --git a/chrome/test/chrome_process_util.cc b/chrome/test/chrome_process_util.cc index ad54a8e..e09351f 100644 --- a/chrome/test/chrome_process_util.cc +++ b/chrome/test/chrome_process_util.cc @@ -29,7 +29,7 @@ void TerminateAllChromeProcesses(base::ProcessId browser_pid) { continue; } - base::KillProcess(handle, ResultCodes::KILLED, true); + base::KillProcess(handle, content::RESULT_CODE_KILLED, true); base::CloseProcessHandle(handle); } } diff --git a/content/browser/browser_message_filter.cc b/content/browser/browser_message_filter.cc index d141c5b..7d1c240 100644 --- a/content/browser/browser_message_filter.cc +++ b/content/browser/browser_message_filter.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -92,7 +92,8 @@ bool BrowserMessageFilter::DispatchMessage(const IPC::Message& message) { } void BrowserMessageFilter::BadMessageReceived() { - base::KillProcess(peer_handle(), ResultCodes::KILLED_BAD_MESSAGE, false); + base::KillProcess(peer_handle(), content::RESULT_CODE_KILLED_BAD_MESSAGE, + false); } bool BrowserMessageFilter::CheckCanDispatchOnUI(const IPC::Message& message, diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index 7bb603f..266eee9 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc @@ -268,7 +268,7 @@ class ChildProcessLauncher::Context base::Process process(handle); // Client has gone away, so just kill the process. Using exit code 0 // means that UMA won't treat this as a crash. - process.Terminate(ResultCodes::NORMAL_EXIT); + process.Terminate(content::RESULT_CODE_NORMAL_EXIT); // On POSIX, we must additionally reap the child. #if defined(OS_POSIX) #if !defined(OS_MACOSX) diff --git a/content/browser/child_process_security_policy_browsertest.cc b/content/browser/child_process_security_policy_browsertest.cc index 14d4b80..91bb58e 100644 --- a/content/browser/child_process_security_policy_browsertest.cc +++ b/content/browser/child_process_security_policy_browsertest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -44,7 +44,7 @@ IN_PROC_BROWSER_TEST_F(ChildProcessSecurityPolicyInProcessBrowserTest, NoLeak) { TabContents* tab = browser()->GetTabContentsAt(0); ASSERT_TRUE(tab != NULL); base::KillProcess(tab->GetRenderProcessHost()->GetHandle(), - ResultCodes::KILLED, true); + content::RESULT_CODE_KILLED, true); tab->controller().Reload(true); EXPECT_EQ( diff --git a/content/browser/handle_enumerator_win.cc b/content/browser/handle_enumerator_win.cc index f16e491..0d5ba51 100644 --- a/content/browser/handle_enumerator_win.cc +++ b/content/browser/handle_enumerator_win.cc @@ -156,7 +156,7 @@ void HandleEnumerator::FindProcessOnUIThread() { void HandleEnumerator::EnumerateHandlesAndTerminateProcess() { HandleEnumerator::EnumerateHandles(); base::Process process(handle_); - process.Terminate(ResultCodes::NORMAL_EXIT); + process.Terminate(content::RESULT_CODE_NORMAL_EXIT); process.Close(); } diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc index 734571e..eeb367b 100644 --- a/content/browser/renderer_host/browser_render_process_host.cc +++ b/content/browser/renderer_host/browser_render_process_host.cc @@ -441,7 +441,8 @@ void BrowserRenderProcessHost::ReceivedBadMessage() { CHECK(false); } NOTREACHED(); - base::KillProcess(GetHandle(), ResultCodes::KILLED_BAD_MESSAGE, false); + base::KillProcess(GetHandle(), content::RESULT_CODE_KILLED_BAD_MESSAGE, + false); } void BrowserRenderProcessHost::WidgetRestored() { diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index 59fdcee8..d6e559c 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -316,7 +316,7 @@ bool WorkerProcessHost::OnMessageReceived(const IPC::Message& message) { if (!msg_is_ok) { NOTREACHED(); UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_WPH")); - base::KillProcess(handle(), ResultCodes::KILLED_BAD_MESSAGE, false); + base::KillProcess(handle(), content::RESULT_CODE_KILLED_BAD_MESSAGE, false); } if (handled) diff --git a/content/browser/zygote_host_linux.cc b/content/browser/zygote_host_linux.cc index 955628d..d6fb504 100644 --- a/content/browser/zygote_host_linux.cc +++ b/content/browser/zygote_host_linux.cc @@ -335,7 +335,7 @@ base::TerminationStatus ZygoteHost::GetTerminationStatus( // Set this now to handle the early termination cases. if (exit_code) - *exit_code = ResultCodes::NORMAL_EXIT; + *exit_code = content::RESULT_CODE_NORMAL_EXIT; static const unsigned kMaxMessageLength = 128; char buf[kMaxMessageLength]; diff --git a/content/browser/zygote_main_linux.cc b/content/browser/zygote_main_linux.cc index 99a7735..25d2051 100644 --- a/content/browser/zygote_main_linux.cc +++ b/content/browser/zygote_main_linux.cc @@ -231,7 +231,7 @@ class Zygote { // Assume that if we can't find the child in the sandbox, then // it terminated normally. status = base::TERMINATION_STATUS_NORMAL_TERMINATION; - exit_code = ResultCodes::NORMAL_EXIT; + exit_code = content::RESULT_CODE_NORMAL_EXIT; } Pickle write_pickle; diff --git a/content/common/process_watcher_win.cc b/content/common/process_watcher_win.cc index 95cf982..e687a69 100644 --- a/content/common/process_watcher_win.cc +++ b/content/common/process_watcher_win.cc @@ -52,7 +52,7 @@ class TimerExpiredTask : public Task, // terminates. We just care that it eventually terminates, and that's what // TerminateProcess should do for us. Don't check for the result code since // it fails quite often. This should be investigated eventually. - base::KillProcess(process_, ResultCodes::HUNG, false); + base::KillProcess(process_, content::RESULT_CODE_HUNG, false); // Now, just cleanup as if the process exited normally. OnObjectSignaled(process_); diff --git a/content/common/result_codes.h b/content/common/result_codes.h index 6a341dd..edfb8b6 100644 --- a/content/common/result_codes.h +++ b/content/common/result_codes.h @@ -18,49 +18,25 @@ // it as an unsigned long and the exception values have high numbers. For // example EXCEPTION_ACCESS_VIOLATION value is 0xC0000005. -class ResultCodes { - public: - enum ExitCode { - NORMAL_EXIT = 0, // Process terminated normally. - KILLED = 1, // Process was killed by user or system. - HUNG = 2, // Process hung. - INVALID_CMDLINE_URL, // An invalid command line url was given. - SBOX_INIT_FAILED, // The sandbox could not be initialized. - GOOGLE_UPDATE_INIT_FAILED, // The Google Update client stub init failed. - GOOGLE_UPDATE_LAUNCH_FAILED,// Google Update could not launch chrome DLL. - BAD_PROCESS_TYPE, // The process is of an unknown type. - MISSING_PATH, // An critical chrome path is missing. - MISSING_DATA, // A critical chrome file is missing. - SHELL_INTEGRATION_FAILED, // Failed to make Chrome default browser. - MACHINE_LEVEL_INSTALL_EXISTS, // Machine level install exists - UNINSTALL_DELETE_FILE_ERROR,// Error while deleting shortcuts. - UNINSTALL_CHROME_ALIVE, // Uninstall detected another chrome instance. - UNINSTALL_NO_SURVEY, // Do not launch survey after uninstall. - UNINSTALL_USER_CANCEL, // The user changed her mind. - UNINSTALL_DELETE_PROFILE, // Delete profile as well during uninstall. - UNSUPPORTED_PARAM, // Command line parameter is not supported. - KILLED_BAD_MESSAGE, // A bad message caused the process termination. - IMPORTER_HUNG, // Browser import hung and was killed. - RESPAWN_FAILED, // Trying to restart the browser we crashed. +namespace content { - NORMAL_EXIT_EXP1, // The EXP1, EXP2, EXP3, EXP4 are generic codes - NORMAL_EXIT_EXP2, // used to communicate some simple outcome back - NORMAL_EXIT_EXP3, // to the process that launched us. This is - NORMAL_EXIT_EXP4, // used for experiments and the actual meaning - // depends on the experiment. +enum ResultCode { + // Process terminated normally. + RESULT_CODE_NORMAL_EXIT = 0, - NORMAL_EXIT_CANCEL, // For experiments this return code means that - // the user canceled causes the did_run "dr" - // signal to be reset so this chrome run does - // not count as active chrome usage. + // Process was killed by user or system. + RESULT_CODE_KILLED = 1, - PROFILE_IN_USE, // The profile was in use on another host. + // Process hung. + RESULT_CODE_HUNG = 2, - UNINSTALL_EXTENSION_ERROR, // Failed to silently uninstall an extension. - PACK_EXTENSION_ERROR, // Failed to pack an extension via the cmd line. + // A bad message caused the process termination. + RESULT_CODE_KILLED_BAD_MESSAGE, - EXIT_LAST_CODE // Last return code (keep it last). - }; + // Last return code (keep this last). + RESULT_CODE_LAST_CODE }; +} // namespace content + #endif // CONTENT_COMMON_RESULT_CODES_H_ |