blob: e4517806a2e28469ae6ff32035fb9257ef064528 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdint.h>
#include <zircon/types.h>
#include <memory>
#include <string>
namespace fuchsia {
namespace crash {
// Crash analysis configuration.
struct Config {
// Directory path under which to store the local Crashpad database.
std::string local_crashpad_database_path;
// Maximum size (in kilobytes) that the local Crashpad database should grow
// to, excluding current reports being generated.
uint64_t max_crashpad_database_size_in_kb;
// Whether to upload the crash report to a remote crash server or leave it
// locally.
bool enable_upload_to_crash_server = false;
// URL of the remote crash server.
// We use a std::unique_ptr to set it only when relevant, i.e. when
// |enable_upload_to_crash_server| is set.
std::unique_ptr<std::string> crash_server_url;
// Maximum time (in milliseconds) spent collecting feedback data to attach to
// crash reports.
uint64_t feedback_data_collection_timeout_in_milliseconds;
// Parses the JSON config at |filepath| as |config|.
zx_status_t ParseConfig(const std::string& filepath, Config* config);
} // namespace crash
} // namespace fuchsia