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

Side by Side Diff: handler/mac/crash_report_exception_handler.cc

Issue 982613002: handler: Add report upload (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 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 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 CrashReportDatabase* database_; // weak 52 CrashReportDatabase* database_; // weak
53 CrashReportDatabase::NewReport* new_report_; // weak 53 CrashReportDatabase::NewReport* new_report_; // weak
54 54
55 DISALLOW_COPY_AND_ASSIGN(CallErrorWritingCrashReport); 55 DISALLOW_COPY_AND_ASSIGN(CallErrorWritingCrashReport);
56 }; 56 };
57 57
58 } // namespace 58 } // namespace
59 59
60 CrashReportExceptionHandler::CrashReportExceptionHandler( 60 CrashReportExceptionHandler::CrashReportExceptionHandler(
61 CrashReportDatabase* database, 61 CrashReportDatabase* database,
62 CrashReportUploadThread* upload_thread) 62 CrashReportUploadThread* upload_thread,
63 const std::map<std::string, std::string>& process_annotations)
63 : database_(database), 64 : database_(database),
64 upload_thread_(upload_thread) { 65 upload_thread_(upload_thread),
66 process_annotations_(process_annotations) {
65 } 67 }
66 68
67 CrashReportExceptionHandler::~CrashReportExceptionHandler() { 69 CrashReportExceptionHandler::~CrashReportExceptionHandler() {
68 } 70 }
69 71
70 kern_return_t CrashReportExceptionHandler::CatchMachException( 72 kern_return_t CrashReportExceptionHandler::CatchMachException(
71 exception_behavior_t behavior, 73 exception_behavior_t behavior,
72 exception_handler_t exception_port, 74 exception_handler_t exception_port,
73 thread_t thread, 75 thread_t thread,
74 task_t task, 76 task_t task,
(...skipping 26 matching lines...) Expand all
101 return KERN_FAILURE; 103 return KERN_FAILURE;
102 } 104 }
103 105
104 ScopedTaskSuspend suspend(task); 106 ScopedTaskSuspend suspend(task);
105 107
106 ProcessSnapshotMac process_snapshot; 108 ProcessSnapshotMac process_snapshot;
107 if (!process_snapshot.Initialize(task)) { 109 if (!process_snapshot.Initialize(task)) {
108 return KERN_FAILURE; 110 return KERN_FAILURE;
109 } 111 }
110 112
113 process_snapshot.SetAnnotationsSimpleMap(process_annotations_);
114
111 CrashReportDatabase::NewReport* new_report; 115 CrashReportDatabase::NewReport* new_report;
112 CrashReportDatabase::OperationStatus database_status = 116 CrashReportDatabase::OperationStatus database_status =
113 database_->PrepareNewCrashReport(&new_report); 117 database_->PrepareNewCrashReport(&new_report);
114 if (database_status != CrashReportDatabase::kNoError) { 118 if (database_status != CrashReportDatabase::kNoError) {
115 return KERN_FAILURE; 119 return KERN_FAILURE;
116 } 120 }
117 121
118 CallErrorWritingCrashReport call_error_writing_crash_report(database_, 122 CallErrorWritingCrashReport call_error_writing_crash_report(database_,
119 new_report); 123 new_report);
120 124
(...skipping 12 matching lines...) Expand all
133 if (database_status != CrashReportDatabase::kNoError) { 137 if (database_status != CrashReportDatabase::kNoError) {
134 return KERN_FAILURE; 138 return KERN_FAILURE;
135 } 139 }
136 140
137 upload_thread_->ReportPending(); 141 upload_thread_->ReportPending();
138 142
139 return ExcServerSuccessfulReturnValue(behavior, false); 143 return ExcServerSuccessfulReturnValue(behavior, false);
140 } 144 }
141 145
142 } // namespace crashpad 146 } // namespace crashpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698