LibreOffice Module desktop (master)  1
crashreport.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef INCLUDED_DESKTOP_CRASHREPORT_HXX
11 #define INCLUDED_DESKTOP_CRASHREPORT_HXX
12 
13 #include <desktop/dllapi.h>
14 
15 #include <rtl/ustring.hxx>
16 #include <osl/mutex.hxx>
17 
18 #include <config_features.h>
19 
20 #include <map>
21 #include <string>
22 
23 namespace google_breakpad
24 {
25 class ExceptionHandler;
26 }
27 
36 class
37 #if HAVE_FEATURE_BREAKPAD
38 // MSVC 2013 has undefined symbols for inline functions if it's exported
40 #endif
41 /*class*/ CrashReporter
42 {
43 public:
44  static void AddKeyValue(const OUString& rKey, const OUString& rValue);
45 
46  static std::string getIniFileName();
47 
48  static void writeCommonInfo();
49 
50  static void storeExceptionHandler(google_breakpad::ExceptionHandler* pExceptionHandler);
51 
52  // when we create the ExceptionHandler we have no access to the user
53  // profile yet, so update when we have access
54  static void updateMinidumpLocation();
55 
56 private:
57 
58  static osl::Mutex maMutex;
59 
60  static bool mbInit;
61 
62  static std::map<OUString, OUString> maKeyValues; // used to temporarily save entries before the old info has been uploaded
63 
64  static google_breakpad::ExceptionHandler* mpExceptionHandler;
65 };
66 
67 // Add dummy methods for the non-breakpad case. That allows us to use
68 // the code without linking to the lib and without adding HAVE_FEATURE_BREAKPAD
69 // everywhere we want to log something to the crash report system.
70 #if HAVE_FEATURE_BREAKPAD
71 #else
72 inline void CrashReporter::AddKeyValue(SAL_UNUSED_PARAMETER const OUString& /*rKey*/, SAL_UNUSED_PARAMETER const OUString& /*rValue*/)
73 {
74 }
75 #endif
76 
77 
78 #endif
79 
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static bool mbInit
Definition: crashreport.hxx:60
static google_breakpad::ExceptionHandler * mpExceptionHandler
Definition: crashreport.hxx:64
Provides access to the crash reporter service.
Definition: crashreport.hxx:36
#define CRASHREPORT_DLLPUBLIC
Definition: dllapi.h:25
static osl::Mutex maMutex
Definition: crashreport.hxx:58
static std::map< OUString, OUString > maKeyValues
Definition: crashreport.hxx:62
static void AddKeyValue(const OUString &rKey, const OUString &rValue)
Definition: crashreport.hxx:72