OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CRASH_CONTENT_APP_CRASHPAD_H_ | 5 #ifndef COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ |
6 #define COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ | 6 #define COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ |
7 | 7 |
8 #include <time.h> | 8 #include <time.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // On Windows, use InitializeCrashpadWithEmbeddedHandler() when crashpad_handler | 52 // On Windows, use InitializeCrashpadWithEmbeddedHandler() when crashpad_handler |
53 // is embedded into this binary and can be started by launching the current | 53 // is embedded into this binary and can be started by launching the current |
54 // process with --type=crashpad-handler. Otherwise, this function should be used | 54 // process with --type=crashpad-handler. Otherwise, this function should be used |
55 // and will launch an external crashpad_handler.exe which is generally used for | 55 // and will launch an external crashpad_handler.exe which is generally used for |
56 // test situations. | 56 // test situations. |
57 void InitializeCrashpad(bool initial_client, const std::string& process_type); | 57 void InitializeCrashpad(bool initial_client, const std::string& process_type); |
58 | 58 |
59 #if defined(OS_WIN) | 59 #if defined(OS_WIN) |
60 // This is the same as InitializeCrashpad(), but rather than launching a | 60 // This is the same as InitializeCrashpad(), but rather than launching a |
61 // crashpad_handler executable, relaunches the current executable with a command | 61 // crashpad_handler executable, relaunches the current executable with a command |
62 // line argument of --type=crashpad-handler. | 62 // line argument of --type=crashpad-handler. If user_data_dir is non-empty, it |
| 63 // is added to the handler's command line for use by Chrome Crashpad extensions. |
63 void InitializeCrashpadWithEmbeddedHandler(bool initial_client, | 64 void InitializeCrashpadWithEmbeddedHandler(bool initial_client, |
64 const std::string& process_type); | 65 const std::string& process_type, |
| 66 const std::string& user_data_dir); |
65 #endif // OS_WIN | 67 #endif // OS_WIN |
66 | 68 |
67 // Returns the CrashpadClient for this process. This will lazily create it if | 69 // Returns the CrashpadClient for this process. This will lazily create it if |
68 // it does not already exist. This is called as part of InitializeCrashpad. | 70 // it does not already exist. This is called as part of InitializeCrashpad. |
69 crashpad::CrashpadClient& GetCrashpadClient(); | 71 crashpad::CrashpadClient& GetCrashpadClient(); |
70 | 72 |
71 // Enables or disables crash report upload, taking the given consent to upload | 73 // Enables or disables crash report upload, taking the given consent to upload |
72 // into account. Consent may be ignored, uploads may not be enabled even with | 74 // into account. Consent may be ignored, uploads may not be enabled even with |
73 // consent, but will only be enabled without consent when policy enforces crash | 75 // consent, but will only be enabled without consent when policy enforces crash |
74 // reporting. Whether reports upload is a property of the Crashpad database. In | 76 // reporting. Whether reports upload is a property of the Crashpad database. In |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 111 |
110 namespace internal { | 112 namespace internal { |
111 | 113 |
112 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
113 // Returns platform specific annotations. This is broken out on Windows only so | 115 // Returns platform specific annotations. This is broken out on Windows only so |
114 // that it may be reused by GetCrashKeysForKasko. | 116 // that it may be reused by GetCrashKeysForKasko. |
115 void GetPlatformCrashpadAnnotations( | 117 void GetPlatformCrashpadAnnotations( |
116 std::map<std::string, std::string>* annotations); | 118 std::map<std::string, std::string>* annotations); |
117 #endif // defined(OS_WIN) | 119 #endif // defined(OS_WIN) |
118 | 120 |
119 // The platform-specific portion of InitializeCrashpad(). | 121 // The platform-specific portion of InitializeCrashpad(). On windows, if |
| 122 // user_data_dir is non-empty, the user data directory will be passed to the |
| 123 // handler process for use by Chrome Crashpad extensions. |
120 // Returns the database path, if initializing in the browser process. | 124 // Returns the database path, if initializing in the browser process. |
121 base::FilePath PlatformCrashpadInitialization(bool initial_client, | 125 base::FilePath PlatformCrashpadInitialization(bool initial_client, |
122 bool browser_process, | 126 bool browser_process, |
123 bool embedded_handler); | 127 bool embedded_handler, |
| 128 const std::string& user_data_dir); |
124 | 129 |
125 } // namespace internal | 130 } // namespace internal |
126 | 131 |
127 } // namespace crash_reporter | 132 } // namespace crash_reporter |
128 | 133 |
129 #endif // COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ | 134 #endif // COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ |
OLD | NEW |