| OLD | NEW |
| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 MinidumpExceptionWriter::MinidumpExceptionWriter() | 26 MinidumpExceptionWriter::MinidumpExceptionWriter() |
| 27 : MinidumpStreamWriter(), exception_(), context_(nullptr) { | 27 : MinidumpStreamWriter(), exception_(), context_(nullptr) { |
| 28 } | 28 } |
| 29 | 29 |
| 30 MinidumpExceptionWriter::~MinidumpExceptionWriter() { | 30 MinidumpExceptionWriter::~MinidumpExceptionWriter() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 void MinidumpExceptionWriter::InitializeFromSnapshot( | 33 void MinidumpExceptionWriter::InitializeFromSnapshot( |
| 34 const ExceptionSnapshot* exception_snapshot, | 34 const ExceptionSnapshot* exception_snapshot, |
| 35 const MinidumpThreadIDMap* thread_id_map) { | 35 const MinidumpThreadIDMap& thread_id_map) { |
| 36 DCHECK_EQ(state(), kStateMutable); | 36 DCHECK_EQ(state(), kStateMutable); |
| 37 DCHECK(!context_); | 37 DCHECK(!context_); |
| 38 | 38 |
| 39 auto thread_id_it = thread_id_map->find(exception_snapshot->ThreadID()); | 39 auto thread_id_it = thread_id_map.find(exception_snapshot->ThreadID()); |
| 40 DCHECK(thread_id_it != thread_id_map->end()); | 40 DCHECK(thread_id_it != thread_id_map.end()); |
| 41 SetThreadID(thread_id_it->second); | 41 SetThreadID(thread_id_it->second); |
| 42 | 42 |
| 43 SetExceptionCode(exception_snapshot->Exception()); | 43 SetExceptionCode(exception_snapshot->Exception()); |
| 44 SetExceptionFlags(exception_snapshot->ExceptionInfo()); | 44 SetExceptionFlags(exception_snapshot->ExceptionInfo()); |
| 45 SetExceptionAddress(exception_snapshot->ExceptionAddress()); | 45 SetExceptionAddress(exception_snapshot->ExceptionAddress()); |
| 46 SetExceptionInformation(exception_snapshot->Codes()); | 46 SetExceptionInformation(exception_snapshot->Codes()); |
| 47 | 47 |
| 48 scoped_ptr<MinidumpContextWriter> context = | 48 scoped_ptr<MinidumpContextWriter> context = |
| 49 MinidumpContextWriter::CreateFromSnapshot(exception_snapshot->Context()); | 49 MinidumpContextWriter::CreateFromSnapshot(exception_snapshot->Context()); |
| 50 SetContext(context.Pass()); | 50 SetContext(context.Pass()); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 DCHECK_EQ(state(), kStateWritable); | 110 DCHECK_EQ(state(), kStateWritable); |
| 111 | 111 |
| 112 return file_writer->Write(&exception_, sizeof(exception_)); | 112 return file_writer->Write(&exception_, sizeof(exception_)); |
| 113 } | 113 } |
| 114 | 114 |
| 115 MinidumpStreamType MinidumpExceptionWriter::StreamType() const { | 115 MinidumpStreamType MinidumpExceptionWriter::StreamType() const { |
| 116 return kMinidumpStreamTypeException; | 116 return kMinidumpStreamTypeException; |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace crashpad | 119 } // namespace crashpad |
| OLD | NEW |