1a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
2a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// found in the LICENSE file.
4a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
5a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#ifndef CHROME_ELF_BREAKPAD_H_
6a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#define CHROME_ELF_BREAKPAD_H_
7a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
8a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include <windows.h>
9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
10a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace google_breakpad {
11a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class ExceptionHandler;
12a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)}
13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
14a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Initializes collection and upload of crash reports. This will only be done if
15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// the user has agreed to crash dump reporting.
16a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)//
17a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Crash reporting has to be initialized as early as possible (e.g., the first
18a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// thing in main()) to catch crashes occuring during process startup.
19a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Crashes which occur during the global static construction phase will not
20a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// be caught and reported. This should not be a problem as static non-POD
21a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// objects are not allowed by the style guide and exceptions to this rule are
22a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// rare.
23a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)void InitializeCrashReporting();
24a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
25a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Generates a crashdump for the provided |exinfo|. This crashdump will be
26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// either be saved locally, or uploaded, depending on how the ExceptionHandler
27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// has been configured.
28a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)int GenerateCrashDump(EXCEPTION_POINTERS* exinfo);
29a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
30a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Global pointer to the ExceptionHandler. This is initialized by
31a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// InitializeCrashReporting() and used by GenerateCrashDump() to record dumps.
32a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)extern google_breakpad::ExceptionHandler* g_elf_breakpad;
33a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
34a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#endif  // CHROME_ELF_BREAKPAD_H_
35