diff options
author | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-15 20:47:40 +0000 |
---|---|---|
committer | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-15 20:47:40 +0000 |
commit | 36d772caff4517f3dc536f582816ac786508e2cb (patch) | |
tree | 97c04d0eb3e3d205ef980686ebb8300a2596e725 /chrome | |
parent | 7fea8ad60431ed71df2a087b131e4a5cde2b6755 (diff) | |
download | chromium_src-36d772caff4517f3dc536f582816ac786508e2cb.zip chromium_src-36d772caff4517f3dc536f582816ac786508e2cb.tar.gz chromium_src-36d772caff4517f3dc536f582816ac786508e2cb.tar.bz2 |
Revert r92730, r92731, r92732 ... will land again once I ensure the win builds compile.
TBR=jam@chromium.org
BUG=none
TEST=
Review URL: http://codereview.chromium.org/7400002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
28 files changed, 91 insertions, 174 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc index d47c99e..f2b29ad 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(chrome::RESULT_CODE_RESPAWN_FAILED); + ::ExitProcess(ResultCodes::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(content::RESULT_CODE_KILLED); + ::ExitProcess(ResultCodes::KILLED); } return EXCEPTION_CONTINUE_SEARCH; } diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc index f1f54eb..28c0da4 100644 --- a/chrome/app/chrome_exe_main_win.cc +++ b/chrome/app/chrome_exe_main_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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 content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::NORMAL_EXIT; } // Initialize the commandline singleton from the environment. diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index ed6ad44..aa15181 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -18,7 +18,6 @@ #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" @@ -26,6 +25,7 @@ #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 chrome::RESULT_CODE_MISSING_DATA; + return ResultCodes::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 chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::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 (chrome::RESULT_CODE_NORMAL_EXIT_CANCEL == return_code) { + if (ResultCodes::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 6370bd8..b3f930b 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 chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int RendererMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int PluginMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int PpapiPluginMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int PpapiBrokerMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int WorkerMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int UtilityMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int ProfileImportMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int ZygoteMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int DiagnosticsMain(const CommandLine& command_line) { @@ -48,9 +48,9 @@ int DiagnosticsMain(const CommandLine& command_line) { } int GpuMain(const MainFunctionParams&) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } int ServiceProcessMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index e8232d7..78d5ab4 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -78,7 +78,6 @@ #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" @@ -95,6 +94,7 @@ #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 chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; + return ResultCodes::NORMAL_EXIT_CANCEL; if (answer == TryChromeDialogView::UNINSTALL_CHROME) - return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; + return ResultCodes::NORMAL_EXIT_EXP2; #else // We don't support retention experiments on Mac or Linux. - return content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::NORMAL_EXIT; #endif // defined(OS_WIN) } @@ -1564,8 +1564,7 @@ int BrowserMain(const MainFunctionParams& parameters) { return HandleIconsCommands(parsed_command_line); if (parsed_command_line.HasSwitch(switches::kMakeDefaultBrowser)) { return ShellIntegration::SetAsDefaultBrowser() ? - static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) : - static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); + ResultCodes::NORMAL_EXIT : ResultCodes::SHELL_INTEGRATION_FAILED; } // If the command line specifies --pack-extension, attempt the pack extension @@ -1573,9 +1572,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 content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::NORMAL_EXIT; } else { - return chrome::RESULT_CODE_PACK_EXTENSION_ERROR; + return ResultCodes::PACK_EXTENSION_ERROR; } } @@ -1601,10 +1600,10 @@ int BrowserMain(const MainFunctionParams& parameters) { printf("%s\n", base::SysWideToNativeMB(UTF16ToWide( l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); #endif - return content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::NORMAL_EXIT; case ProcessSingleton::PROFILE_IN_USE: - return chrome::RESULT_CODE_PROFILE_IN_USE; + return ResultCodes::PROFILE_IN_USE; case ProcessSingleton::LOCK_ERROR: LOG(ERROR) << "Failed to create a ProcessSingleton for your profile " @@ -1612,7 +1611,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 chrome::RESULT_CODE_PROFILE_IN_USE; + return ResultCodes::PROFILE_IN_USE; default: NOTREACHED(); @@ -1660,7 +1659,7 @@ int BrowserMain(const MainFunctionParams& parameters) { Profile* profile = CreateProfile(parameters, user_data_dir); if (!profile) - return content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::NORMAL_EXIT; // Post-profile init --------------------------------------------------------- @@ -1702,7 +1701,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 content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::NORMAL_EXIT; #endif // Check if there is any machine level Chrome installed on the current @@ -1715,7 +1714,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 chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS; + return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; // Create the TranslateManager singleton. TranslateManager* translate_manager = TranslateManager::GetInstance(); @@ -1728,7 +1727,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 content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::NORMAL_EXIT; } } #endif @@ -1920,9 +1919,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 content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::NORMAL_EXIT; } else { - return chrome::RESULT_CODE_UNINSTALL_EXTENSION_ERROR; + return ResultCodes::UNINSTALL_EXTENSION_ERROR; } } @@ -1967,7 +1966,7 @@ int BrowserMain(const MainFunctionParams& parameters) { // Start watching all browser threads for responsiveness. ThreadWatcherList::StartWatchingAll(parsed_command_line); - int result_code = content::RESULT_CODE_NORMAL_EXIT; + int result_code = ResultCodes::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 98480e0..3701a57 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 content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::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 4e91371..c5e9ab5 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 content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::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 0f52bea..3611b21 100644 --- a/chrome/browser/browser_main_win.cc +++ b/chrome/browser/browser_main_win.cc @@ -25,7 +25,6 @@ #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" @@ -33,6 +32,7 @@ #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 = content::RESULT_CODE_NORMAL_EXIT; + int ret = ResultCodes::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 chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; + return ResultCodes::UNINSTALL_CHROME_ALIVE; } int ret = AskForUninstallConfirmation(); if (browser_util::IsBrowserAlreadyRunning()) { ShowCloseBrowserFirstMessageBox(); - return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; + return ResultCodes::UNINSTALL_CHROME_ALIVE; } - if (ret != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { + if (ret != ResultCodes::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 chrome::RESULT_CODE_UNSUPPORTED_PARAM; // Not supported + return ResultCodes::UNSUPPORTED_PARAM; // Not supported } const string16 msg = @@ -234,12 +234,10 @@ 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); - - // Exit as we are not launching the browser. - return content::RESULT_CODE_NORMAL_EXIT; + return ResultCodes::NORMAL_EXIT; // Exit as we are not launching browser. } // We don't hide icons so we shouldn't do anything special to show them - return chrome::RESULT_CODE_UNSUPPORTED_PARAM; + return ResultCodes::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 c325afa..b6e9db1 100644 --- a/chrome/browser/extensions/extension_crash_recovery_browsertest.cc +++ b/chrome/browser/extensions/extension_crash_recovery_browsertest.cc @@ -73,8 +73,7 @@ class ExtensionCrashRecoveryTest : public ExtensionBrowserTest { RenderProcessHost* extension_rph = extension_host->render_view_host()->process(); - base::KillProcess(extension_rph->GetHandle(), content::RESULT_CODE_KILLED, - false); + base::KillProcess(extension_rph->GetHandle(), ResultCodes::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 0374dd0..5b814fd 100644 --- a/chrome/browser/extensions/extension_function.cc +++ b/chrome/browser/extensions/extension_function.cc @@ -112,8 +112,7 @@ void ExtensionFunction::HandleBadMessage(base::ProcessHandle process) { NOTREACHED(); UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_EFD")); if (process) - base::KillProcess(process, content::RESULT_CODE_KILLED_BAD_MESSAGE, - false); + base::KillProcess(process, ResultCodes::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 0e07390..b82205c 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_(content::RESULT_CODE_NORMAL_EXIT) { + : loop_running_(false), import_result_(ResultCodes::NORMAL_EXIT) { } FirstRunImportObserver::~FirstRunImportObserver() { @@ -25,6 +25,6 @@ void FirstRunImportObserver::Finish() { } void FirstRunImportObserver::ImportCompleted() { - import_result_ = content::RESULT_CODE_NORMAL_EXIT; + import_result_ = ResultCodes::NORMAL_EXIT; Finish(); } diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc index d4c91ceb..2a62ad7 100644 --- a/chrome/browser/first_run/first_run_win.cc +++ b/chrome/browser/first_run/first_run_win.cc @@ -28,7 +28,6 @@ #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" @@ -39,6 +38,7 @@ #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_(content::RESULT_CODE_NORMAL_EXIT) { + exit_code_(ResultCodes::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_, chrome::RESULT_CODE_IMPORTER_HUNG); + ::TerminateProcess(import_process_, ResultCodes::IMPORTER_HUNG); import_process_ = NULL; } } @@ -356,7 +356,7 @@ bool FirstRun::ImportSettings(Profile* profile, if (profile) profile->GetPrefs()->ReloadPersistentPrefs(); - return (import_runner.exit_code() == content::RESULT_CODE_NORMAL_EXIT); + return (import_runner.exit_code() == ResultCodes::NORMAL_EXIT); } // static diff --git a/chrome/browser/hang_monitor/hung_window_detector.cc b/chrome/browser/hang_monitor/hung_window_detector.cc index 035f270..39bedc6 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) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2008 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, content::RESULT_CODE_HUNG); + TerminateProcess(child_process, ResultCodes::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 49a245a..b21610e 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, content::RESULT_CODE_HUNG, true); + base::KillProcessById(process_id, ResultCodes::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 235dc3d..b2e8471 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(), - content::RESULT_CODE_KILLED, true); + ResultCodes::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 0f2703b..0e64113dd 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, content::RESULT_CODE_KILLED, false); + base::KillProcess(process, ResultCodes::KILLED, false); } void TaskManager::ActivateProcess(int index) { diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index 1060eb5..fd6bbd5 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -54,7 +54,6 @@ #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" @@ -65,6 +64,7 @@ #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 = chrome::RESULT_CODE_INVALID_CMDLINE_URL; + *return_code = ResultCodes::INVALID_CMDLINE_URL; return false; } diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc index ac7aa30..48a5d1b 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(content::RESULT_CODE_NORMAL_EXIT); + ExitProcess(ResultCodes::NORMAL_EXIT); #elif defined(OS_POSIX) && !defined(OS_MACOSX) - _exit(content::RESULT_CODE_NORMAL_EXIT); + _exit(ResultCodes::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 f8dc950..bbd0a60 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(), - content::RESULT_CODE_HUNG, false); + ResultCodes::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 a8d9910..e4eecde 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(), - content::RESULT_CODE_HUNG, false); + ResultCodes::HUNG, false); } break; diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index 0a55287..117e86c 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(), - content::RESULT_CODE_HUNG); + ResultCodes::HUNG); } } } diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc index 1e80a3b..f0a9928 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_ = content::RESULT_CODE_NORMAL_EXIT; + user_selection_ = ResultCodes::NORMAL_EXIT; if (delete_profile_->checked()) - user_selection_ = chrome::RESULT_CODE_UNINSTALL_DELETE_PROFILE; + user_selection_ = ResultCodes::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_ = chrome::RESULT_CODE_UNINSTALL_USER_CANCEL; + user_selection_ = ResultCodes::UNINSTALL_USER_CANCEL; return true; } diff --git a/chrome/common/chrome_result_codes.h b/chrome/common/chrome_result_codes.h deleted file mode 100644 index b380851..0000000 --- a/chrome/common/chrome_result_codes.h +++ /dev/null @@ -1,78 +0,0 @@ -// 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 77ca61e..56f2bdd 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -16,7 +16,6 @@ #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" @@ -33,6 +32,7 @@ #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, - content::RESULT_CODE_HUNG, NULL); + ResultCodes::HUNG, NULL); base::CleanupProcesses(installer::kNaClExe, 0, - content::RESULT_CODE_HUNG, NULL); + ResultCodes::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, - content::RESULT_CODE_HUNG, NULL); + ResultCodes::HUNG, NULL); base::CleanupProcesses(installer::kNaClExe, 15000, - content::RESULT_CODE_HUNG, NULL); + ResultCodes::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, - content::RESULT_CODE_HUNG, NULL); + ResultCodes::HUNG, NULL); } } @@ -440,7 +440,7 @@ DeleteResult DeleteFilesAndFolders(const InstallerState& installer_state, InstallStatus IsChromeActiveOrUserCancelled( const InstallerState& installer_state, const Product& product) { - int32 exit_code = content::RESULT_CODE_NORMAL_EXIT; + int32 exit_code = ResultCodes::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 == chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE) || - (exit_code == chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) || - (exit_code == chrome::RESULT_CODE_HUNG)) + if ((exit_code == ResultCodes::UNINSTALL_CHROME_ALIVE) || + (exit_code == ResultCodes::UNINSTALL_USER_CANCEL) || + (exit_code == ResultCodes::HUNG)) return installer::UNINSTALL_CANCELLED; - if (exit_code == chrome::RESULT_CODE_UNINSTALL_DELETE_PROFILE) + if (exit_code == ResultCodes::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 dc1c835..11d2128 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -24,7 +24,6 @@ #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" @@ -37,6 +36,7 @@ #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 content::RESULT_CODE_NORMAL_EXIT: + case ResultCodes::NORMAL_EXIT: outcome = kToastExpTriesOkGroup; break; - case chrome::RESULT_CODE_NORMAL_EXIT_CANCEL: + case ResultCodes::NORMAL_EXIT_CANCEL: outcome = kToastExpCancelGroup; break; - case chrome::RESULT_CODE_NORMAL_EXIT_EXP2: + case ResultCodes::NORMAL_EXIT_EXP2: outcome = kToastExpUninstallGroup; break; default: diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc index 6d882d3..64adb2c 100644 --- a/chrome/nacl/nacl_main.cc +++ b/chrome/nacl/nacl_main.cc @@ -13,7 +13,6 @@ #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" @@ -21,6 +20,7 @@ #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 chrome::RESULT_CODE_BAD_PROCESS_TYPE; + return ResultCodes::BAD_PROCESS_TYPE; } #endif // _WIN64 diff --git a/chrome/service/service_child_process_host.cc b/chrome/service/service_child_process_host.cc index e25dd59..d111e90 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(), content::RESULT_CODE_NORMAL_EXIT, false); + base::KillProcess(handle(), ResultCodes::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 e09351f..ad54a8e 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, content::RESULT_CODE_KILLED, true); + base::KillProcess(handle, ResultCodes::KILLED, true); base::CloseProcessHandle(handle); } } |