OLD | NEW |
| (Empty) |
1 // Copyright 2007-2009 Google Inc. | |
2 // | |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 // you may not use this file except in compliance with the License. | |
5 // You may obtain a copy of the License at | |
6 // | |
7 // http://www.apache.org/licenses/LICENSE-2.0 | |
8 // | |
9 // Unless required by applicable law or agreed to in writing, software | |
10 // distributed under the License is distributed on an "AS IS" BASIS, | |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 // See the License for the specific language governing permissions and | |
13 // limitations under the License. | |
14 // ======================================================================== | |
15 | |
16 #ifndef OMAHA_CORE_CRASH_HANDLER_H_ | |
17 #define OMAHA_CORE_CRASH_HANDLER_H_ | |
18 | |
19 #include <windows.h> | |
20 #include "base/basictypes.h" | |
21 #include "base/scoped_ptr.h" | |
22 #include "omaha/base/scoped_any.h" | |
23 #include "omaha/base/shutdown_callback.h" | |
24 #include "third_party/breakpad/src/client/windows/crash_generation/client_info.h
" | |
25 #include "third_party/breakpad/src/client/windows/crash_generation/crash_generat
ion_server.h" | |
26 | |
27 namespace omaha { | |
28 | |
29 class Reactor; | |
30 class ShutdownHandler; | |
31 | |
32 class CrashHandler : public ShutdownCallback { | |
33 public: | |
34 CrashHandler(); | |
35 virtual ~CrashHandler(); | |
36 | |
37 // Executes the instance entry point with given parameters. | |
38 HRESULT Main(bool is_system); | |
39 | |
40 Reactor* reactor() const { return reactor_.get(); } | |
41 bool is_system() const { return is_system_; } | |
42 | |
43 private: | |
44 typedef google_breakpad::CrashGenerationServer CrashGenerationServer; | |
45 | |
46 // ShutdownCallback interface. | |
47 // Signals the CrashHandler to stop handling events and exit. | |
48 virtual HRESULT Shutdown(); | |
49 | |
50 HRESULT DoRun(); | |
51 HRESULT DoHandleEvents(); | |
52 | |
53 bool is_system_; | |
54 | |
55 DWORD main_thread_id_; // The id of the thread that runs CrashHandler::Main. | |
56 | |
57 scoped_ptr<Reactor> reactor_; | |
58 scoped_ptr<ShutdownHandler> shutdown_handler_; | |
59 | |
60 DISALLOW_EVIL_CONSTRUCTORS(CrashHandler); | |
61 }; | |
62 | |
63 } // namespace omaha | |
64 | |
65 #endif // OMAHA_CORE_CRASH_HANDLER_H_ | |
66 | |
OLD | NEW |