Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: components/crash/content/app/crashpad.h

Issue 2748903003: [Mac] Use Crashpad in the AlertNotificationService.xpc. (Closed)
Patch Set: Comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "build/build_config.h"
16
17 #if defined(OS_MACOSX)
18 #include "base/mac/scoped_mach_port.h"
19 #endif
20
21 namespace crashpad {
22 class CrashpadClient;
23 }
15 24
16 namespace crash_reporter { 25 namespace crash_reporter {
17 26
18 // Initializes Crashpad in a way that is appropriate for initial_client and 27 // Initializes Crashpad in a way that is appropriate for initial_client and
19 // process_type. 28 // process_type.
20 // 29 //
21 // If initial_client is true, this starts crashpad_handler and sets it as the 30 // If initial_client is true, this starts crashpad_handler and sets it as the
22 // exception handler. Child processes will inherit this exception handler, and 31 // exception handler. Child processes will inherit this exception handler, and
23 // should specify false for this parameter. Although they inherit the exception 32 // should specify false for this parameter. Although they inherit the exception
24 // handler, child processes still need to call this function to perform 33 // handler, child processes still need to call this function to perform
(...skipping 23 matching lines...) Expand all
48 void InitializeCrashpad(bool initial_client, const std::string& process_type); 57 void InitializeCrashpad(bool initial_client, const std::string& process_type);
49 58
50 #if defined(OS_WIN) 59 #if defined(OS_WIN)
51 // This is the same as InitializeCrashpad(), but rather than launching a 60 // This is the same as InitializeCrashpad(), but rather than launching a
52 // crashpad_handler executable, relaunches the current executable with a command 61 // crashpad_handler executable, relaunches the current executable with a command
53 // line argument of --type=crashpad-handler. 62 // line argument of --type=crashpad-handler.
54 void InitializeCrashpadWithEmbeddedHandler(bool initial_client, 63 void InitializeCrashpadWithEmbeddedHandler(bool initial_client,
55 const std::string& process_type); 64 const std::string& process_type);
56 #endif // OS_WIN 65 #endif // OS_WIN
57 66
67 // 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.
69 crashpad::CrashpadClient& GetCrashpadClient();
Mark Mentovai 2017/03/15 19:38:43 Non-const ref or pointer, either one is fine by me
70
58 // Enables or disables crash report upload, taking the given consent to upload 71 // Enables or disables crash report upload, taking the given consent to upload
59 // into account. Consent may be ignored, uploads may not be enabled even with 72 // into account. Consent may be ignored, uploads may not be enabled even with
60 // consent, but will only be enabled without consent when policy enforces crash 73 // consent, but will only be enabled without consent when policy enforces crash
61 // reporting. Whether reports upload is a property of the Crashpad database. In 74 // reporting. Whether reports upload is a property of the Crashpad database. In
62 // a newly-created database, uploads will be disabled. This function only has an 75 // a newly-created database, uploads will be disabled. This function only has an
63 // effect when called in the browser process. Its effect is immediate and 76 // effect when called in the browser process. Its effect is immediate and
64 // applies to all other process types, including processes that are already 77 // applies to all other process types, including processes that are already
65 // running. 78 // running.
66 void SetUploadConsent(bool consent); 79 void SetUploadConsent(bool consent);
67 80
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Returns the database path, if initializing in the browser process. 120 // Returns the database path, if initializing in the browser process.
108 base::FilePath PlatformCrashpadInitialization(bool initial_client, 121 base::FilePath PlatformCrashpadInitialization(bool initial_client,
109 bool browser_process, 122 bool browser_process,
110 bool embedded_handler); 123 bool embedded_handler);
111 124
112 } // namespace internal 125 } // namespace internal
113 126
114 } // namespace crash_reporter 127 } // namespace crash_reporter
115 128
116 #endif // COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ 129 #endif // COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/notifications/xpc_mach_port.mm ('k') | components/crash/content/app/crashpad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698