| 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_APP_BREAKPAD_CLIENT_H_ |
| 6 #define COMPONENTS_BREAKPAD_BREAKPAD_CLIENT_H_ | 6 #define COMPONENTS_BREAKPAD_APP_BREAKPAD_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class FilePath; | 14 class FilePath; |
| 15 } | 15 } |
| 16 | 16 |
| 17 #if defined(OS_MACOSX) | 17 #if defined(OS_MACOSX) |
| 18 // We don't want to directly include | 18 // We don't want to directly include |
| 19 // breakpad/src/client/mac/Framework/Breakpad.h here, so we repeat the | 19 // breakpad/src/client/mac/Framework/Breakpad.h here, so we repeat the |
| 20 // definition of BreakpadRef. | 20 // definition of BreakpadRef. |
| 21 // | 21 // |
| 22 // On Mac, when compiling without breakpad support, a stub implementation is | 22 // On Mac, when compiling without breakpad support, a stub implementation is |
| 23 // compiled in. Not having any includes of the breakpad library allows for | 23 // compiled in. Not having any includes of the breakpad library allows for |
| 24 // reusing this header for the stub. | 24 // reusing this header for the stub. |
| 25 typedef void* BreakpadRef; | 25 typedef void* BreakpadRef; |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 namespace breakpad { | 28 namespace breakpad { |
| 29 | 29 |
| 30 class BreakpadClient; | 30 class BreakpadClient; |
| 31 | 31 |
| 32 // Setter and getter for the client. The client should be set early, before any | 32 // Setter and getter for the client. The client should be set early, before any |
| 33 // breakpad code is called, and should stay alive throughout the entire runtime. | 33 // breakpad code is called, and should stay alive throughout the entire runtime. |
| 34 void SetBreakpadClient(BreakpadClient* client); | 34 void SetBreakpadClient(BreakpadClient* client); |
| 35 | 35 |
| 36 #if defined(BREAKPAD_IMPLEMENTATION) |
| 36 // Breakpad's embedder API should only be used by breakpad. | 37 // Breakpad's embedder API should only be used by breakpad. |
| 37 BreakpadClient* GetBreakpadClient(); | 38 BreakpadClient* GetBreakpadClient(); |
| 39 #endif |
| 38 | 40 |
| 39 // Interface that the embedder implements. | 41 // Interface that the embedder implements. |
| 40 class BreakpadClient { | 42 class BreakpadClient { |
| 41 public: | 43 public: |
| 42 BreakpadClient(); | 44 BreakpadClient(); |
| 43 virtual ~BreakpadClient(); | 45 virtual ~BreakpadClient(); |
| 44 | 46 |
| 45 // Sets the Breakpad client ID, which is a unique identifier for the client | 47 // Sets the Breakpad client ID, which is a unique identifier for the client |
| 46 // that is sending crash reports. After it is set, it should not be changed. | 48 // that is sending crash reports. After it is set, it should not be changed. |
| 47 virtual void SetClientID(const std::string& client_id); | 49 virtual void SetClientID(const std::string& client_id); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 #endif | 134 #endif |
| 133 | 135 |
| 134 #if defined(OS_MACOSX) | 136 #if defined(OS_MACOSX) |
| 135 // Install additional breakpad filter callbacks. | 137 // Install additional breakpad filter callbacks. |
| 136 virtual void InstallAdditionalFilters(BreakpadRef breakpad); | 138 virtual void InstallAdditionalFilters(BreakpadRef breakpad); |
| 137 #endif | 139 #endif |
| 138 }; | 140 }; |
| 139 | 141 |
| 140 } // namespace breakpad | 142 } // namespace breakpad |
| 141 | 143 |
| 142 #endif // COMPONENTS_BREAKPAD_BREAKPAD_CLIENT_H_ | 144 #endif // COMPONENTS_BREAKPAD_APP_BREAKPAD_CLIENT_H_ |
| OLD | NEW |