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

Unified Diff: chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h

Issue 2242833003: Add the most recent crash report IDs to feedback reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RFR Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h
diff --git a/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h b/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h
new file mode 100644
index 0000000000000000000000000000000000000000..099aebe18b80ada61a9123be55e3fea1ef025378
--- /dev/null
+++ b/chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_CRASH_IDS_SOURCE_H_
+#define CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_CRASH_IDS_SOURCE_H_
+
+#include <vector>
+
+#include "base/callback_forward.h"
+#include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h"
+#include "components/upload_list/crash_upload_list.h"
+#include "components/upload_list/upload_list.h"
+
+namespace system_logs {
+
+// Extract the most recent crash IDs (if any) and adds them to the system logs.
+class CrashIdsSource : public SystemLogsSource, public UploadList::Delegate {
+ public:
+ CrashIdsSource();
+ ~CrashIdsSource() override;
+
+ // SystemLogsSource:
+ void Fetch(const SysLogsSourceCallback& callback) override;
+
+ // UploadList::Delegate:
+ void OnUploadListAvailable() override;
+
+ private:
+ void RespondWithCrashIds(const SysLogsSourceCallback& callback) const;
+
+ scoped_refptr<CrashUploadList> crash_upload_list_;
+
+ // A comma-separated list of crash IDs as expected by the server.
+ std::string crash_ids_list_;
+
+ // Contains any pending fetch requests waiting for the crash upload list to
+ // finish loading.
+ using Requests = base::Closure;
Rahul Chaturvedi 2016/09/08 19:58:24 This seems, not very useful. base::Closure is bare
afakhry 2016/09/09 22:20:10 Makes sense ... Done.
+ std::vector<Requests> pending_requests_;
+
+ // True if the crash list is currently being loaded.
+ bool pending_crash_list_loading_;
+
+ DISALLOW_COPY_AND_ASSIGN(CrashIdsSource);
+};
+
+} // namespace system_logs
+
+#endif // CHROME_BROWSER_FEEDBACK_SYSTEM_LOGS_LOG_SOURCES_CRASH_IDS_SOURCE_H_

Powered by Google App Engine
This is Rietveld 408576698