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

Side by Side Diff: client/crashpad_info.h

Issue 651283003: Add crashpad_info, MachOImageAnnotationsReader, and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Refactor to reduce deep nesting Created 6 years, 2 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
(Empty)
1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef CRASHPAD_CLIENT_CRASHPAD_INFO_H_
16 #define CRASHPAD_CLIENT_CRASHPAD_INFO_H_
17
18 #include "base/basictypes.h"
19
20 #include <stdint.h>
21
22 #include "client/simple_string_dictionary.h"
23
24 namespace crashpad {
25
26 //! \brief A structure that can be used by a Crashpad-enabled program to
27 //! provide information to the Crashpad crash handler.
28 //!
29 //! It is possible for one CrashpadInfo structure to appear in each loaded code
30 //! module in a process, but from the perspective of the user of the client
31 //! interface, there is only one global CrashpadInfo structure, located in the
32 //! module that contains the client interface code.
33 struct CrashpadInfo {
34 public:
35 //! \brief Returns the global CrashpadInfo structure.
36 static CrashpadInfo* GetCrashpadInfo();
37
38 CrashpadInfo();
39
40 void set_simple_annotations(SimpleStringDictionary* simple_annotations) {
41 simple_annotations_ = simple_annotations;
42 }
43
44 private:
45 // The compiler won’t necessarily see anyone using these fields, but it
46 // shouldn’t warn about that. These fields aren’t intended for use by the
47 // process they’re found in, they’re supposed to be read by the crash
48 // reporting process.
49 #pragma clang diagnostic push
50 #pragma clang diagnostic ignored "-Wunused-private-field"
51 // Fields present in version 1:
52 uint32_t signature_; // kSignature
53 uint32_t size_; // The size of the entire CrashpadInfo structure.
54 uint32_t version_; // kVersion
55 uint32_t padding_0_;
56 SimpleStringDictionary* simple_annotations_; // weak
57 #pragma clang diagnostic pop
58
59 DISALLOW_COPY_AND_ASSIGN(CrashpadInfo);
60 };
61
62 } // namespace crashpad
63
64 #endif // CRASHPAD_CLIENT_CRASHPAD_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698