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

Side by Side Diff: client/crashpad_client.h

Issue 1095273003: crashpad client for windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: review changes Created 5 years, 7 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 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 //! This method does not actually direct any crashes to the Crashpad handler, 42 //! This method does not actually direct any crashes to the Crashpad handler,
43 //! because there may be alternative ways to use an existing Crashpad handler 43 //! because there may be alternative ways to use an existing Crashpad handler
44 //! without having to start one. To begin directing crashes to the handler, 44 //! without having to start one. To begin directing crashes to the handler,
45 //! started by this method, call UseHandler() after this method returns 45 //! started by this method, call UseHandler() after this method returns
46 //! successfully. 46 //! successfully.
47 //! 47 //!
48 //! On Mac OS X, this method starts a Crashpad handler and obtains a Mach 48 //! On Mac OS X, this method starts a Crashpad handler and obtains a Mach
49 //! send right corresponding to a receive right held by the handler process. 49 //! send right corresponding to a receive right held by the handler process.
50 //! The handler process runs an exception server on this port. 50 //! The handler process runs an exception server on this port.
51 //! 51 //!
52 //! On Windows, SetHandler() is normally used instead since the handler is
53 //! started by other means.
54 //!
52 //! \param[in] handler The path to a Crashpad handler executable. 55 //! \param[in] handler The path to a Crashpad handler executable.
53 //! \param[in] database The path to a Crashpad database. The handler will be 56 //! \param[in] database The path to a Crashpad database. The handler will be
54 //! started with this path as its `--database` argument. 57 //! started with this path as its `--database` argument.
55 //! \param[in] url The URL of an upload server. The handler will be started 58 //! \param[in] url The URL of an upload server. The handler will be started
56 //! with this URL as its `--url` argument. 59 //! with this URL as its `--url` argument.
57 //! \param[in] annotations Process annotations to set in each crash report. 60 //! \param[in] annotations Process annotations to set in each crash report.
58 //! The handler will be started with an `--annotation` argument for each 61 //! The handler will be started with an `--annotation` argument for each
59 //! element in this map. 62 //! element in this map.
60 //! \param[in] arguments Additional arguments to pass to the Crashpad handler. 63 //! \param[in] arguments Additional arguments to pass to the Crashpad handler.
61 //! Arguments passed in other parameters and arguments required to perform 64 //! Arguments passed in other parameters and arguments required to perform
62 //! the handshake are the responsibility of this method, and must not be 65 //! the handshake are the responsibility of this method, and must not be
63 //! specified in this parameter. 66 //! specified in this parameter.
64 //! 67 //!
65 //! \return `true` on success, `false` on failure with a message logged. 68 //! \return `true` on success, `false` on failure with a message logged.
66 bool StartHandler(const base::FilePath& handler, 69 bool StartHandler(const base::FilePath& handler,
67 const base::FilePath& database, 70 const base::FilePath& database,
68 const std::string& url, 71 const std::string& url,
69 const std::map<std::string, std::string>& annotations, 72 const std::map<std::string, std::string>& annotations,
70 const std::vector<std::string>& arguments); 73 const std::vector<std::string>& arguments);
71 74
75 //! \brief Sets the IPC port of a presumably-running Crashpad handler process
76 //! which was started with StartHandler() or by other compatible means
77 //! and does an IPC message exchange to register this process with the
78 //! handler. However, just like StartHandler(), crashes are not serviced
79 //! until UseHandler() is called.
80 //!
81 //! The IPC port name (somehow) encodes enough information so that
82 //! registration is done with a crash handler using the appropiate database
83 //! and upload server.
84 //!
85 //! \param[in] ipc_port The full name of the crash handler IPC port.
86 //!
87 //! \return `true` on success and `false` on failure.
88 #if defined(OS_WIN)
Mark Mentovai 2015/04/29 20:17:25 Move this above the //! brief that applies to it.
89 bool SetHandler(const std::string& ipc_port);
90 #endif
Mark Mentovai 2015/04/29 20:17:25 and put a blank line after the #endif.
72 //! \brief Configures the process to direct its crashes to a Crashpad handler. 91 //! \brief Configures the process to direct its crashes to a Crashpad handler.
73 //! 92 //!
74 //! The Crashpad handler must previously have been started by StartHandler(). 93 //! The Crashpad handler must previously have been started by StartHandler()
94 //! or configured by SetHandler().
75 //! 95 //!
76 //! On Mac OS X, this method sets the task’s exception port for `EXC_CRASH`, 96 //! On Mac OS X, this method sets the task’s exception port for `EXC_CRASH`,
77 //! `EXC_RESOURCE`, and `EXC_GUARD` exceptions to the Mach send right obtained 97 //! `EXC_RESOURCE`, and `EXC_GUARD` exceptions to the Mach send right obtained
78 //! by StartHandler(). The handler will be installed with behavior 98 //! by StartHandler(). The handler will be installed with behavior
79 //! `EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES` and thread state flavor 99 //! `EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES` and thread state flavor
80 //! `MACHINE_THREAD_STATE`. Exception ports are inherited, so a Crashpad 100 //! `MACHINE_THREAD_STATE`. Exception ports are inherited, so a Crashpad
81 //! handler chosen by UseHandler() will remain the handler for any child 101 //! handler chosen by UseHandler() will remain the handler for any child
82 //! processes created after UseHandler() is called. Child processes do not 102 //! processes created after UseHandler() is called. Child processes do not
83 //! need to call StartHandler() or UseHandler() or be aware of Crashpad in any 103 //! need to call StartHandler() or UseHandler() or be aware of Crashpad in any
84 //! way. The Crashpad handler will receive crashes from child processes that 104 //! way. The Crashpad handler will receive crashes from child processes that
85 //! have inherited it as their exception handler even after the process that 105 //! have inherited it as their exception handler even after the process that
86 //! called StartHandler() exits. 106 //! called StartHandler() exits.
87 //! 107 //!
108 //! On Windows, this method sets the unhandled exception handler to a local
109 //! function that when reached it will "signal and wait" for the crash
Mark Mentovai 2015/04/29 20:17:25 Extraneous “it”.
110 //! handler process to create the dump.
111 //!
88 //! \return `true` on success, `false` on failure with a message logged. 112 //! \return `true` on success, `false` on failure with a message logged.
89 bool UseHandler(); 113 bool UseHandler();
90 114
91 private: 115 private:
92 #if defined(OS_MACOSX) 116 #if defined(OS_MACOSX)
93 base::mac::ScopedMachSendRight exception_port_; 117 base::mac::ScopedMachSendRight exception_port_;
94 #endif 118 #endif
95 119
96 DISALLOW_COPY_AND_ASSIGN(CrashpadClient); 120 DISALLOW_COPY_AND_ASSIGN(CrashpadClient);
97 }; 121 };
98 122
99 } // namespace crashpad 123 } // namespace crashpad
100 124
101 #endif // CRASHPAD_CLIENT_CRASHPAD_CLIENT_H_ 125 #endif // CRASHPAD_CLIENT_CRASHPAD_CLIENT_H_
OLDNEW
« no previous file with comments | « client/client.gyp ('k') | client/crashpad_client_win.cc » ('j') | client/crashpad_client_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698