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

Side by Side Diff: snapshot/mac/module_snapshot_mac.cc

Issue 997713002: Allow exception forwarding to the system’s native crash reporter to be disabled (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 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 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 timestamp_ = process_reader_module.timestamp; 48 timestamp_ = process_reader_module.timestamp;
49 mach_o_image_reader_ = process_reader_module.reader; 49 mach_o_image_reader_ = process_reader_module.reader;
50 if (!mach_o_image_reader_) { 50 if (!mach_o_image_reader_) {
51 return false; 51 return false;
52 } 52 }
53 53
54 INITIALIZATION_STATE_SET_VALID(initialized_); 54 INITIALIZATION_STATE_SET_VALID(initialized_);
55 return true; 55 return true;
56 } 56 }
57 57
58 void ModuleSnapshotMac::GetCrashpadOptions(CrashpadInfoClientOptions* options) {
59 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
60
61 process_types::CrashpadInfo crashpad_info;
62 if (!mach_o_image_reader_->GetCrashpadInfo(&crashpad_info)) {
63 options->crashpad_handler_behavior =
64 CrashpadInfoClientOptions::TriState::kDefault;
65 options->system_crash_reporter_forwarding =
66 CrashpadInfoClientOptions::TriState::kDefault;
67 return;
68 }
69
70 options->crashpad_handler_behavior =
71 CrashpadInfoClientOptions::TriStateFromCrashpadInfo(
72 crashpad_info.crashpad_handler_behavior);
73
74 options->system_crash_reporter_forwarding =
75 CrashpadInfoClientOptions::TriStateFromCrashpadInfo(
76 crashpad_info.system_crash_reporter_forwarding);
77 }
78
58 std::string ModuleSnapshotMac::Name() const { 79 std::string ModuleSnapshotMac::Name() const {
59 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 80 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
60 return name_; 81 return name_;
61 } 82 }
62 83
63 uint64_t ModuleSnapshotMac::Address() const { 84 uint64_t ModuleSnapshotMac::Address() const {
64 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 85 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
65 return mach_o_image_reader_->Address(); 86 return mach_o_image_reader_->Address();
66 } 87 }
67 88
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 std::map<std::string, std::string> ModuleSnapshotMac::AnnotationsSimpleMap() 166 std::map<std::string, std::string> ModuleSnapshotMac::AnnotationsSimpleMap()
146 const { 167 const {
147 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 168 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
148 MachOImageAnnotationsReader annotations_reader( 169 MachOImageAnnotationsReader annotations_reader(
149 process_reader_, mach_o_image_reader_, name_); 170 process_reader_, mach_o_image_reader_, name_);
150 return annotations_reader.SimpleMap(); 171 return annotations_reader.SimpleMap();
151 } 172 }
152 173
153 } // namespace internal 174 } // namespace internal
154 } // namespace crashpad 175 } // namespace crashpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698