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 30 matching lines...) Expand all Loading... |
41 DCHECK(!list_annotations_); | 41 DCHECK(!list_annotations_); |
42 DCHECK(!simple_annotations_); | 42 DCHECK(!simple_annotations_); |
43 | 43 |
44 uint32_t module_list_index_u32; | 44 uint32_t module_list_index_u32; |
45 if (!AssignIfInRange(&module_list_index_u32, module_list_index)) { | 45 if (!AssignIfInRange(&module_list_index_u32, module_list_index)) { |
46 LOG(ERROR) << "module_list_index " << module_list_index << " out of range"; | 46 LOG(ERROR) << "module_list_index " << module_list_index << " out of range"; |
47 return; | 47 return; |
48 } | 48 } |
49 SetMinidumpModuleListIndex(module_list_index_u32); | 49 SetMinidumpModuleListIndex(module_list_index_u32); |
50 | 50 |
51 auto list_annotations = | 51 auto list_annotations = make_scoped_ptr(new MinidumpUTF8StringListWriter()); |
52 make_scoped_ptr(new internal::MinidumpUTF8StringListWriter()); | |
53 list_annotations->InitializeFromVector(module_snapshot->AnnotationsVector()); | 52 list_annotations->InitializeFromVector(module_snapshot->AnnotationsVector()); |
54 if (list_annotations->IsUseful()) { | 53 if (list_annotations->IsUseful()) { |
55 SetListAnnotations(list_annotations.Pass()); | 54 SetListAnnotations(list_annotations.Pass()); |
56 } | 55 } |
57 | 56 |
58 auto simple_annotations = | 57 auto simple_annotations = |
59 make_scoped_ptr(new MinidumpSimpleStringDictionaryWriter()); | 58 make_scoped_ptr(new MinidumpSimpleStringDictionaryWriter()); |
60 simple_annotations->InitializeFromMap( | 59 simple_annotations->InitializeFromMap( |
61 module_snapshot->AnnotationsSimpleMap()); | 60 module_snapshot->AnnotationsSimpleMap()); |
62 if (simple_annotations->IsUseful()) { | 61 if (simple_annotations->IsUseful()) { |
63 SetSimpleAnnotations(simple_annotations.Pass()); | 62 SetSimpleAnnotations(simple_annotations.Pass()); |
64 } | 63 } |
65 } | 64 } |
66 | 65 |
67 void MinidumpModuleCrashpadInfoWriter::SetListAnnotations( | 66 void MinidumpModuleCrashpadInfoWriter::SetListAnnotations( |
68 scoped_ptr<internal::MinidumpUTF8StringListWriter> list_annotations) { | 67 scoped_ptr<MinidumpUTF8StringListWriter> list_annotations) { |
69 DCHECK_EQ(state(), kStateMutable); | 68 DCHECK_EQ(state(), kStateMutable); |
70 | 69 |
71 list_annotations_ = list_annotations.Pass(); | 70 list_annotations_ = list_annotations.Pass(); |
72 } | 71 } |
73 | 72 |
74 void MinidumpModuleCrashpadInfoWriter::SetSimpleAnnotations( | 73 void MinidumpModuleCrashpadInfoWriter::SetSimpleAnnotations( |
75 scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations) { | 74 scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations) { |
76 DCHECK_EQ(state(), kStateMutable); | 75 DCHECK_EQ(state(), kStateMutable); |
77 | 76 |
78 simple_annotations_ = simple_annotations.Pass(); | 77 simple_annotations_ = simple_annotations.Pass(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 154 } |
156 | 155 |
157 void MinidumpModuleCrashpadInfoListWriter::AddModule( | 156 void MinidumpModuleCrashpadInfoListWriter::AddModule( |
158 scoped_ptr<MinidumpModuleCrashpadInfoWriter> module) { | 157 scoped_ptr<MinidumpModuleCrashpadInfoWriter> module) { |
159 DCHECK_EQ(state(), kStateMutable); | 158 DCHECK_EQ(state(), kStateMutable); |
160 | 159 |
161 AddChild(module.Pass()); | 160 AddChild(module.Pass()); |
162 } | 161 } |
163 | 162 |
164 } // namespace crashpad | 163 } // namespace crashpad |
OLD | NEW |