| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_BREAKPAD_BREAKPAD_CLIENT_H_ | 5 #ifndef COMPONENTS_BREAKPAD_BREAKPAD_CLIENT_H_ |
| 6 #define COMPONENTS_BREAKPAD_BREAKPAD_CLIENT_H_ | 6 #define COMPONENTS_BREAKPAD_BREAKPAD_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/strings/string16.h" |
| 9 #include "build/build_config.h" |
| 9 | 10 |
| 10 namespace base { | 11 namespace base { |
| 11 class FilePath; | 12 class FilePath; |
| 12 } | 13 } |
| 13 | 14 |
| 14 namespace breakpad { | 15 namespace breakpad { |
| 15 | 16 |
| 16 class BreakpadClient; | 17 class BreakpadClient; |
| 17 | 18 |
| 18 // Setter and getter for the client. The client should be set early, before any | 19 // Setter and getter for the client. The client should be set early, before any |
| 19 // breakpad code is called, and should stay alive throughout the entire runtime. | 20 // breakpad code is called, and should stay alive throughout the entire runtime. |
| 20 void SetBreakpadClient(BreakpadClient* client); | 21 void SetBreakpadClient(BreakpadClient* client); |
| 21 | 22 |
| 22 // Breakpad's embedder API should only be used by breakpad. | 23 // Breakpad's embedder API should only be used by breakpad. |
| 23 BreakpadClient* GetBreakpadClient(); | 24 BreakpadClient* GetBreakpadClient(); |
| 24 | 25 |
| 25 // Interface that the embedder implements. | 26 // Interface that the embedder implements. |
| 26 class BreakpadClient { | 27 class BreakpadClient { |
| 27 public: | 28 public: |
| 28 BreakpadClient(); | 29 BreakpadClient(); |
| 29 virtual ~BreakpadClient(); | 30 virtual ~BreakpadClient(); |
| 30 | 31 |
| 31 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 32 // Returns true if an alternative location to store the minidump files was | 33 // Returns true if an alternative location to store the minidump files was |
| 33 // specified. Returns true if |crash_dir| was set. | 34 // specified. Returns true if |crash_dir| was set. |
| 34 virtual bool GetAlternativeCrashDumpLocation(base::FilePath* crash_dir); | 35 virtual bool GetAlternativeCrashDumpLocation(base::FilePath* crash_dir); |
| 36 |
| 37 // Returns a textual description of the product type and version to include |
| 38 // in the crash report. |
| 39 virtual void GetProductNameAndVersion(const base::FilePath& exe_path, |
| 40 base::string16* product_name, |
| 41 base::string16* version, |
| 42 base::string16* special_build); |
| 35 #endif | 43 #endif |
| 36 | 44 |
| 37 // The location where minidump files should be written. Returns true if | 45 // The location where minidump files should be written. Returns true if |
| 38 // |crash_dir| was set. | 46 // |crash_dir| was set. |
| 39 virtual bool GetCrashDumpLocation(base::FilePath* crash_dir); | 47 virtual bool GetCrashDumpLocation(base::FilePath* crash_dir); |
| 40 | 48 |
| 41 #if defined(OS_POSIX) | 49 #if defined(OS_POSIX) |
| 42 // Sets a function that'll be invoked to dump the current process when | 50 // Sets a function that'll be invoked to dump the current process when |
| 43 // without crashing. | 51 // without crashing. |
| 44 virtual void SetDumpWithoutCrashingFunction(void (*function)()); | 52 virtual void SetDumpWithoutCrashingFunction(void (*function)()); |
| 45 #endif | 53 #endif |
| 46 }; | 54 }; |
| 47 | 55 |
| 48 } // namespace breakpad | 56 } // namespace breakpad |
| 49 | 57 |
| 50 #endif // COMPONENTS_BREAKPAD_BREAKPAD_CLIENT_H_ | 58 #endif // COMPONENTS_BREAKPAD_BREAKPAD_CLIENT_H_ |
| OLD | NEW |