summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstoyan@google.com <stoyan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-26 18:15:59 +0000
committerstoyan@google.com <stoyan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-26 18:15:59 +0000
commitaff8a13ec56589a853f73686db770f2adad4ae2f (patch)
treea4e52750a3cc16e5a40de719da02403c97532b52
parenta2bf82f595bf80542ea5011656a86f8fc89e17ee (diff)
downloadchromium_src-aff8a13ec56589a853f73686db770f2adad4ae2f.zip
chromium_src-aff8a13ec56589a853f73686db770f2adad4ae2f.tar.gz
chromium_src-aff8a13ec56589a853f73686db770f2adad4ae2f.tar.bz2
Move creation of SEH frame into a separate funcion.For any function that uses SEH, the compiler creates a single EXCEPTION_REGISTRATION record at the function prolog (even if the function has nested or inside condition statement __try/__except constructs). When __try block is entered and leaved only the index to the relevant scope table is updated.When the exception occurs the __except_handler4 may ignore it if there is no scope table set i.e. we are outside __try block.In ChromeFrame when exception happens, the global vectored exception filter walks through the SEH chain and is misled that there is handler/filter installed and therefore skips creation of a crashdump.
BUG=23845 TEST=crashes in ChromeFrame background threads are reported. Review URL: http://codereview.chromium.org/335011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30066 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/message_loop.cc18
-rw-r--r--base/message_loop.h6
2 files changed, 17 insertions, 7 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc
index bf5256a..ddca7dbf 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -169,18 +169,24 @@ void MessageLoop::RunAllPending() {
void MessageLoop::RunHandler() {
#if defined(OS_WIN)
if (exception_restoration_) {
- LPTOP_LEVEL_EXCEPTION_FILTER current_filter = GetTopSEHFilter();
- __try {
- RunInternal();
- } __except(SEHFilter(current_filter)) {
- }
+ RunInternalInSEHFrame();
return;
}
#endif
RunInternal();
}
-
+//------------------------------------------------------------------------------
+#if defined(OS_WIN)
+__declspec(noinline) void MessageLoop::RunInternalInSEHFrame() {
+ LPTOP_LEVEL_EXCEPTION_FILTER current_filter = GetTopSEHFilter();
+ __try {
+ RunInternal();
+ } __except(SEHFilter(current_filter)) {
+ }
+ return;
+}
+#endif
//------------------------------------------------------------------------------
void MessageLoop::RunInternal() {
diff --git a/base/message_loop.h b/base/message_loop.h
index d2fcc12..ff4531c 100644
--- a/base/message_loop.h
+++ b/base/message_loop.h
@@ -303,9 +303,13 @@ class MessageLoop : public base::MessagePump::Delegate {
// A function to encapsulate all the exception handling capability in the
// stacks around the running of a main message loop. It will run the message
// loop in a SEH try block or not depending on the set_SEH_restoration()
- // flag.
+ // flag invoking respectively RunInternalInSEHFrame() or RunInternal().
void RunHandler();
+#if defined(OS_WIN)
+ __declspec(noinline) void RunInternalInSEHFrame();
+#endif
+
// A surrounding stack frame around the running of the message loop that
// supports all saving and restoring of state, as is needed for any/all (ugly)
// recursive calls.