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

Side by Side Diff: minidump/minidump_exception_writer.cc

Issue 703223003: Add MinidumpFileWriter::InitializeFromSnapshot() and its tests (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_crashpad_info_init_from_snapshot
Patch Set: Address review feedback Created 6 years, 1 month 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 | « minidump/minidump_exception_writer.h ('k') | minidump/minidump_exception_writer_test.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 14 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « minidump/minidump_exception_writer.h ('k') | minidump/minidump_exception_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698