Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: chrome_frame/crash_reporting/vectored_handler.h

Issue 264068: Refactoring of crash reporting code in Chrome Frame... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_FRAME_VECTORED_HANDLER_H_ 5 #ifndef CHROME_FRAME_CRASH_REPORTING_VECTORED_HANDLER_H_
6 #define CHROME_FRAME_VECTORED_HANDLER_H_ 6 #define CHROME_FRAME_CRASH_REPORTING_VECTORED_HANDLER_H_
7 7
8 // Base class for VectoredHandlerT just to hold some members (independent of 8 // Base class for VectoredHandlerT just to hold some members (independent of
9 // template parameter) 9 // template parameter)
10 class VectoredHandlerBase { 10 class VectoredHandlerBase {
11 public: 11 public:
12 // For RtlCaptureStackBackTrace MSDN says: 12 // For RtlCaptureStackBackTrace MSDN says:
13 // Windows Server 2003 and Windows XP: The sum of the FramesToSkip and 13 // Windows Server 2003 and Windows XP: The sum of the FramesToSkip and
14 // FramesToCapture parameters must be less than 64. 14 // FramesToCapture parameters must be less than 64.
15 // In practice (on XPSP2) it has to be less than 63, hence leaving us with 15 // In practice (on XPSP2) it has to be less than 63, hence leaving us with
16 // max back trace of 62. 16 // max back trace of 62.
17 static const DWORD max_back_trace = 62; 17 static const DWORD max_back_trace = 62;
18 static unsigned long g_exceptions_seen; 18 static unsigned long g_exceptions_seen;
19 protected: 19 protected:
20 static void* g_handler; 20 static void* g_handler;
21 }; 21 };
22 22
23 DECLSPEC_SELECTANY void* VectoredHandlerBase::g_handler; 23 DECLSPEC_SELECTANY void* VectoredHandlerBase::g_handler;
24 DECLSPEC_SELECTANY unsigned long VectoredHandlerBase::g_exceptions_seen; 24 DECLSPEC_SELECTANY unsigned long VectoredHandlerBase::g_exceptions_seen;
25 25
26 // The E class is supposed to provide external/API functions. Using template 26 // The E class is supposed to provide external/API functions. Using template
27 // make testability easier. It shall confirm the following concept/archetype: 27 // make testability easier. It shall confirm the following concept/archetype:
28 // void* Register(PVECTORED_EXCEPTION_HANDLER, 28 // void* Register(PVECTORED_EXCEPTION_HANDLER,
29 // const void* module_start, const void* module_end) 29 // const void* module_start, const void* module_end)
30 // Registers Vectored Exception Handler, non-unittest implementation shall call 30 // Registers Vectored Exception Handler, non-unittest implementation shall call
31 // ::AddVectoredExceptionHandler Win32 API 31 // ::AddVectoredExceptionHandler Win32 API
32 // ULONG Unregister(void*) - ::RemoveVectoredExceptionHandler Win32 API 32 // ULONG Unregister(void*) - ::RemoveVectoredExceptionHandler Win32 API
33 // int IsOurModule(const void* address) - 33 // int IsOurModule(const void* address) -
34 // void WriteDump(EXCEPTION_POINTERS*) - 34 // void WriteDump(EXCEPTION_POINTERS*) -
35 // WORD RtlCaptureStackBackTrace(..) - same as Win32 API 35 // WORD RtlCaptureStackBackTrace(..) - same as Win32 API
36 // EXCEPTION_REGISTRATION_RECORD* RtlpGetExceptionList() - same as Win32 API 36 // EXCEPTION_REGISTRATION_RECORD* RtlpGetExceptionList() - same as Win32 API
37 // You may want to derive own External class by deriving from 37 // You may want to derive own External class by deriving from
38 // VEHExternalBase helper (see below). 38 // VEHExternalBase helper (see below).
39 // Create dump policy: 39 // Create dump policy:
40 // 1. Scan SEH chain, if there is a handler/filter that belongs to our 40 // 1. Scan SEH chain, if there is a handler/filter that belongs to our
41 // module - assume we expect this one and hence do nothing here. 41 // module - assume we expect this one and hence do nothing here.
42 // 2. If the address of the exception is in our module - create dump. 42 // 2. If the address of the exception is in our module - create dump.
43 // 3. If our module is in somewhere in callstack - create dump. 43 // 3. If our module is in somewhere in callstack - create dump.
44 template <class E> 44 template <class E>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 g_module_start = module_start; 77 g_module_start = module_start;
78 g_module_end = module_end; 78 g_module_end = module_end;
79 } 79 }
80 }; 80 };
81 81
82 DECLSPEC_SELECTANY const void* VEHTraitsBase::g_module_start; 82 DECLSPEC_SELECTANY const void* VEHTraitsBase::g_module_start;
83 DECLSPEC_SELECTANY const void* VEHTraitsBase::g_module_end; 83 DECLSPEC_SELECTANY const void* VEHTraitsBase::g_module_end;
84 84
85 class Win32VEHTraits; 85 class Win32VEHTraits;
86 typedef class VectoredHandlerT<Win32VEHTraits> VectoredHandler; 86 typedef class VectoredHandlerT<Win32VEHTraits> VectoredHandler;
87 #endif // CHROME_FRAME_VECTORED_HANDLER_H_ 87 #endif // CHROME_FRAME_CRASH_REPORTING_VECTORED_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome_frame/crash_reporting/crash_reporting.gyp ('k') | chrome_frame/crash_reporting/vectored_handler-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698