| Index: client/settings.h
|
| diff --git a/client/settings.h b/client/settings.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..90def7d6bc972bebd144e4b0ed04c08762135f4f
|
| --- /dev/null
|
| +++ b/client/settings.h
|
| @@ -0,0 +1,95 @@
|
| +// Copyright 2015 The Crashpad Authors. All rights reserved.
|
| +//
|
| +// Licensed under the Apache License, Version 2.0 (the "License");
|
| +// you may not use this file except in compliance with the License.
|
| +// You may obtain a copy of the License at
|
| +//
|
| +// http://www.apache.org/licenses/LICENSE-2.0
|
| +//
|
| +// Unless required by applicable law or agreed to in writing, software
|
| +// distributed under the License is distributed on an "AS IS" BASIS,
|
| +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| +// See the License for the specific language governing permissions and
|
| +// limitations under the License.
|
| +
|
| +#ifndef CRASHPAD_CLIENT_SETTINGS_H_
|
| +#define CRASHPAD_CLIENT_SETTINGS_H_
|
| +
|
| +#include <time.h>
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/basictypes.h"
|
| +
|
| +namespace crashpad {
|
| +
|
| +//! \brief An interface for accessing and modifying the settings of a
|
| +//! CrashReportDatabase.
|
| +//!
|
| +//! This class cannot be instantiated directly, but rather an instance of it
|
| +//! should be retrieved via CrashReportDatabase::GetSettings().
|
| +class Settings {
|
| + public:
|
| + //! \brief Retrieves the immutable identifier for this client, which is used
|
| + //! to locate all crash reports from a specific Crashpad database.
|
| + //!
|
| + //! This is automatically initialized when the database is created.
|
| + //!
|
| + //! \param[out] client_id The unique client identifier.
|
| + //!
|
| + //! \return On success, returns `true`, otherwise returns `false` with an
|
| + //! error logged.
|
| + virtual bool GetClientID(std::string* client_id) = 0;
|
| +
|
| + //! \brief Retrieves the user’s preference for submitting crash reports to a
|
| + //! collection server.
|
| + //!
|
| + //! The default value is `false`.
|
| + //!
|
| + //! \param[out] enabled Whether crash reports should be uploaded.
|
| + //!
|
| + //! \return On success, returns `true`, otherwise returns `false` with an
|
| + //! error logged.
|
| + virtual bool GetUploadsEnabled(bool* enabled) = 0;
|
| +
|
| + //! \brief Sets the user’s preference for submitting crash reports to a
|
| + //! collection server.
|
| + //!
|
| + //! \param[in] enabled Whether crash reports should be uploaded.
|
| + //!
|
| + //! \return On success, returns `true`, otherwise returns `false` with an
|
| + //! error logged.
|
| + virtual bool SetUploadsEnabled(bool enabled) = 0;
|
| +
|
| + //! \brief Retrieves the last time at which a report was attempted to be
|
| + //! uploaded.
|
| + //!
|
| + //! The default value is `0` if it has never been set before.
|
| + //!
|
| + //! \param[out] time The last time at which a report was uploaded.
|
| + //!
|
| + //! \return On success, returns `true`, otherwise returns `false` with an
|
| + //! error logged.
|
| + virtual bool GetLastUploadAttemptTime(time_t* time) = 0;
|
| +
|
| + //! \brief Sets the last time at which a report was attempted to be uploaded.
|
| + //!
|
| + //! This is only meant to be used internally by the CrashReportDatabase.
|
| + //!
|
| + //! \param[in] time The last time at which a report was uploaded.
|
| + //!
|
| + //! \return On success, returns `true`, otherwise returns `false` with an
|
| + //! error logged.
|
| + virtual bool SetLastUploadAttemptTime(time_t time) = 0;
|
| +
|
| + protected:
|
| + Settings() {}
|
| + virtual ~Settings() {}
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(Settings);
|
| +};
|
| +
|
| +} // namespace crashpad
|
| +
|
| +#endif // CRASHPAD_CLIENT_SETTINGS_H_
|
|
|