mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
39 lines
1.7 KiB
Diff
39 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jeremy Apthorp <jeremya@chromium.org>
|
|
Date: Fri, 1 May 2020 18:25:59 -0700
|
|
Subject: upload_list: add LoadSync method
|
|
|
|
This allows synchronous loading of the upload list, which is required by
|
|
the crashReporter.getUploadedReports() API. The synchronous version is
|
|
deprecated, and this API should be removed once the deprecated behavior
|
|
is no longer supported.
|
|
|
|
diff --git a/components/upload_list/upload_list.cc b/components/upload_list/upload_list.cc
|
|
index e39549c9bb552dc19cad3685629406fdbe44c2c7..428b0f486767b630fc42e0e19c8d63bdb2d04cbc 100644
|
|
--- a/components/upload_list/upload_list.cc
|
|
+++ b/components/upload_list/upload_list.cc
|
|
@@ -71,6 +71,10 @@ void UploadList::Load(base::OnceClosure callback) {
|
|
base::BindOnce(&UploadList::OnLoadComplete, this));
|
|
}
|
|
|
|
+void UploadList::LoadSync() {
|
|
+ uploads_ = LoadUploadList();
|
|
+}
|
|
+
|
|
void UploadList::Clear(const base::Time& begin,
|
|
const base::Time& end,
|
|
base::OnceClosure callback) {
|
|
diff --git a/components/upload_list/upload_list.h b/components/upload_list/upload_list.h
|
|
index 20358339df63ae2bb8b955870c5daf51b65f19f7..7cf89626bea8ee9436f15366446f053a479ac438 100644
|
|
--- a/components/upload_list/upload_list.h
|
|
+++ b/components/upload_list/upload_list.h
|
|
@@ -73,6 +73,8 @@ class UploadList : public base::RefCountedThreadSafe<UploadList> {
|
|
// overwrite the previously supplied one, and the first will not be called.
|
|
void Load(base::OnceClosure callback);
|
|
|
|
+ void LoadSync();
|
|
+
|
|
// Clears any data associated with the upload list, where the upload time or
|
|
// capture time falls within the given range.
|
|
void Clear(const base::Time& begin,
|