summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authordpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 20:07:08 +0000
committerdpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 20:07:08 +0000
commit785c9672b5f4e423487147904930110dae0049d9 (patch)
treec4fef8478f128c7a6aa3d49db9e8d6eb50432bbc /content
parent6bff761d7589fc7b638de6f1ce684f559711316b (diff)
downloadchromium_src-785c9672b5f4e423487147904930110dae0049d9.zip
chromium_src-785c9672b5f4e423487147904930110dae0049d9.tar.gz
chromium_src-785c9672b5f4e423487147904930110dae0049d9.tar.bz2
This change will split the result codes between content and chrome.
This adds a new file into chrome/common and does a lot of renaming. The current version is just a sketch of the headers, and nothing will compile. R=jam@chromium.org BUG=76699 TEST=everything still compiles and runs Review URL: http://codereview.chromium.org/7377010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/browser_message_filter.cc5
-rw-r--r--content/browser/child_process_launcher.cc2
-rw-r--r--content/browser/child_process_security_policy_browsertest.cc4
-rw-r--r--content/browser/handle_enumerator_win.cc2
-rw-r--r--content/browser/renderer_host/browser_render_process_host.cc3
-rw-r--r--content/browser/worker_host/worker_process_host.cc2
-rw-r--r--content/browser/zygote_host_linux.cc2
-rw-r--r--content/browser/zygote_main_linux.cc2
-rw-r--r--content/common/process_watcher_win.cc2
-rw-r--r--content/common/result_codes.h52
10 files changed, 27 insertions, 49 deletions
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_