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

Unified Diff: client/settings.h

Issue 988063003: Define the Settings interface for a CrashReportDatabase and provide a Mac implementation. (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 9 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: client/settings.h
diff --git a/client/settings.h b/client/settings.h
new file mode 100644
index 0000000000000000000000000000000000000000..6aa702c9fc13dbd24ebd9272796f22d995c76362
--- /dev/null
+++ b/client/settings.h
@@ -0,0 +1,89 @@
+// 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 {
Mark Mentovai 2015/03/08 05:21:56 I thought this might be a nested class inside Cras
Robert Sesek 2015/03/08 22:15:36 The Database interface is large enough as it is. A
+ public:
+ //! \brief Retrieves the immutable identifier for this client, which is used
+ //! to locate all crash reports from a specific Crashpad database.
+ //!
+ //! \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;
Mark Mentovai 2015/03/08 05:21:56 Shouldn’t this pass a UUID* back?
Robert Sesek 2015/03/08 22:15:35 I think the server is going to deal only in string
Mark Mentovai 2015/03/09 14:01:23 Robert Sesek wrote:
+
+ //! \brief Retrieves the user’s preference for submitting crash reports to a
+ //! collection server.
+ //!
+ //! \param[out] enabled Whether crash reports should be uploaded.
+ //!
+ //! \return On success, returns `true`, otherwise returns `false` with an
+ //! error logged.
Mark Mentovai 2015/03/08 05:21:56 As implemented for Mac, these can return false wit
Robert Sesek 2015/03/08 22:15:35 Done.
+ 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.
+ //!
+ //! \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_

Powered by Google App Engine
This is Rietveld 408576698