activity_report_user_stream_data_source.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_BROWSER_WATCHER_ACTIVITY_REPORT_USER_STREAM_DATA_SOURCE_H_
  5. #define COMPONENTS_BROWSER_WATCHER_ACTIVITY_REPORT_USER_STREAM_DATA_SOURCE_H_
  6. #include <memory>
  7. #include "base/files/file_path.h"
  8. #include "third_party/crashpad/crashpad/handler/user_stream_data_source.h"
  9. namespace crashpad {
  10. class MinidumpUserExtensionStreamDataSource;
  11. class ProcessSnapshot;
  12. } // namespace crashpad
  13. namespace browser_watcher {
  14. // Collects stability instrumentation corresponding to a ProcessSnapshot and
  15. // makes it available to the crash handler.
  16. class ActivityReportUserStreamDataSource
  17. : public crashpad::UserStreamDataSource {
  18. public:
  19. explicit ActivityReportUserStreamDataSource(
  20. const base::FilePath& user_data_dir);
  21. ActivityReportUserStreamDataSource(
  22. const ActivityReportUserStreamDataSource&) = delete;
  23. ActivityReportUserStreamDataSource& operator=(
  24. const ActivityReportUserStreamDataSource&) = delete;
  25. std::unique_ptr<crashpad::MinidumpUserExtensionStreamDataSource>
  26. ProduceStreamData(crashpad::ProcessSnapshot* process_snapshot) override;
  27. private:
  28. base::FilePath user_data_dir_;
  29. };
  30. } // namespace browser_watcher
  31. #endif // COMPONENTS_BROWSER_WATCHER_ACTIVITY_REPORT_USER_STREAM_DATA_SOURCE_H_