OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/crash_upload_list/crash_upload_list_crashpad.h" | 5 #include "chrome/browser/crash_upload_list/crash_upload_list_crashpad.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/threading/sequenced_worker_pool.h" | 9 #include <utility> |
| 10 |
| 11 #include "base/task_runner.h" |
10 #include "base/time/time.h" | 12 #include "base/time/time.h" |
11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
12 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
13 #include "components/crash/content/app/crashpad.h" | 15 #include "components/crash/content/app/crashpad.h" |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
18 typedef void (*GetCrashReportsPointer)( | 20 typedef void (*GetCrashReportsPointer)( |
19 const crash_reporter::Report** reports, | 21 const crash_reporter::Report** reports, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 75 } |
74 | 76 |
75 NOTREACHED(); | 77 NOTREACHED(); |
76 return UploadList::UploadInfo::State::Uploaded; | 78 return UploadList::UploadInfo::State::Uploaded; |
77 } | 79 } |
78 | 80 |
79 } // namespace | 81 } // namespace |
80 | 82 |
81 CrashUploadListCrashpad::CrashUploadListCrashpad( | 83 CrashUploadListCrashpad::CrashUploadListCrashpad( |
82 Delegate* delegate, | 84 Delegate* delegate, |
83 const scoped_refptr<base::SequencedWorkerPool>& worker_pool) | 85 scoped_refptr<base::TaskRunner> task_runner) |
84 : CrashUploadList(delegate, base::FilePath(), worker_pool) {} | 86 : CrashUploadList(delegate, base::FilePath(), std::move(task_runner)) {} |
85 | 87 |
86 CrashUploadListCrashpad::~CrashUploadListCrashpad() {} | 88 CrashUploadListCrashpad::~CrashUploadListCrashpad() {} |
87 | 89 |
88 void CrashUploadListCrashpad::LoadUploadList( | 90 void CrashUploadListCrashpad::LoadUploadList( |
89 std::vector<UploadList::UploadInfo>* uploads) { | 91 std::vector<UploadList::UploadInfo>* uploads) { |
90 std::vector<crash_reporter::Report> reports; | 92 std::vector<crash_reporter::Report> reports; |
91 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
92 // On Windows, we only link crash client into chrome.exe (not the dlls), and | 94 // On Windows, we only link crash client into chrome.exe (not the dlls), and |
93 // it does the registration. That means the global that holds the crash report | 95 // it does the registration. That means the global that holds the crash report |
94 // database lives in the .exe, so we need to grab a pointer to a helper in the | 96 // database lives in the .exe, so we need to grab a pointer to a helper in the |
(...skipping 14 matching lines...) Expand all Loading... |
109 void CrashUploadListCrashpad::RequestSingleCrashUpload( | 111 void CrashUploadListCrashpad::RequestSingleCrashUpload( |
110 const std::string& local_id) { | 112 const std::string& local_id) { |
111 #if defined(OS_WIN) | 113 #if defined(OS_WIN) |
112 // On Windows, crash reporting is handled by chrome_elf.dll, that's why we | 114 // On Windows, crash reporting is handled by chrome_elf.dll, that's why we |
113 // can't call crash_reporter::RequestSingleCrashUpload directly. | 115 // can't call crash_reporter::RequestSingleCrashUpload directly. |
114 RequestSingleCrashUploadThunk(local_id); | 116 RequestSingleCrashUploadThunk(local_id); |
115 #else | 117 #else |
116 crash_reporter::RequestSingleCrashUpload(local_id); | 118 crash_reporter::RequestSingleCrashUpload(local_id); |
117 #endif | 119 #endif |
118 } | 120 } |
OLD | NEW |