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

Side by Side Diff: snapshot/exception_snapshot_mac.cc

Issue 656703002: Convert NULL to nullptr (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Fix 80-column violations 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
« no previous file with comments | « snapshot/cpu_context_mac_test.cc ('k') | snapshot/memory_snapshot_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 code_index < code_count; 54 code_index < code_count;
55 ++code_index) { 55 ++code_index) {
56 codes_.push_back(code[code_index]); 56 codes_.push_back(code[code_index]);
57 } 57 }
58 58
59 exception_ = exception; 59 exception_ = exception;
60 mach_exception_code_t exception_code_0 = code[0]; 60 mach_exception_code_t exception_code_0 = code[0];
61 61
62 if (exception_ == EXC_CRASH) { 62 if (exception_ == EXC_CRASH) {
63 exception_ = ExcCrashRecoverOriginalException( 63 exception_ = ExcCrashRecoverOriginalException(
64 exception_code_0, &exception_code_0, NULL); 64 exception_code_0, &exception_code_0, nullptr);
65 } 65 }
66 66
67 // ExceptionInfo() returns code[0] in a 32-bit field. This shouldn’t be a 67 // ExceptionInfo() returns code[0] in a 32-bit field. This shouldn’t be a
68 // problem because code[0]’s values never exceed 32 bits. Only code[1] is ever 68 // problem because code[0]’s values never exceed 32 bits. Only code[1] is ever
69 // expected to be that wide. 69 // expected to be that wide.
70 if (!AssignIfInRange(&exception_code_0_, exception_code_0)) { 70 if (!AssignIfInRange(&exception_code_0_, exception_code_0)) {
71 LOG(WARNING) 71 LOG(WARNING)
72 << base::StringPrintf("exception_code_0 0x%llx out of range", 72 << base::StringPrintf("exception_code_0 0x%llx out of range",
73 exception_code_0); 73 exception_code_0);
74 return false; 74 return false;
75 } 75 }
76 76
77 const ProcessReader::Thread* thread = NULL; 77 const ProcessReader::Thread* thread = nullptr;
78 for (const ProcessReader::Thread& loop_thread : process_reader->Threads()) { 78 for (const ProcessReader::Thread& loop_thread : process_reader->Threads()) {
79 if (exception_thread == loop_thread.port) { 79 if (exception_thread == loop_thread.port) {
80 thread = &loop_thread; 80 thread = &loop_thread;
81 break; 81 break;
82 } 82 }
83 } 83 }
84 84
85 if (!thread) { 85 if (!thread) {
86 LOG(WARNING) << "exception_thread not found in task"; 86 LOG(WARNING) << "exception_thread not found in task";
87 return false; 87 return false;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return exception_address_; 166 return exception_address_;
167 } 167 }
168 168
169 const std::vector<uint64_t>& ExceptionSnapshotMac::Codes() const { 169 const std::vector<uint64_t>& ExceptionSnapshotMac::Codes() const {
170 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 170 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
171 return codes_; 171 return codes_;
172 } 172 }
173 173
174 } // namespace internal 174 } // namespace internal
175 } // namespace crashpad 175 } // namespace crashpad
OLDNEW
« no previous file with comments | « snapshot/cpu_context_mac_test.cc ('k') | snapshot/memory_snapshot_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698