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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef CRASHPAD_CLIENT_SETTINGS_H_
16 #define CRASHPAD_CLIENT_SETTINGS_H_
17
18 #include <time.h>
19
20 #include <string>
21
22 #include "base/basictypes.h"
23
24 namespace crashpad {
25
26 //! \brief An interface for accessing and modifying the settings of a
27 //! CrashReportDatabase.
28 //!
29 //! This class cannot be instantiated directly, but rather an instance of it
30 //! should be retrieved via CrashReportDatabase::GetSettings().
31 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
32 public:
33 //! \brief Retrieves the immutable identifier for this client, which is used
34 //! to locate all crash reports from a specific Crashpad database.
35 //!
36 //! \param[out] client_id The unique client identifier.
37 //!
38 //! \return On success, returns `true`, otherwise returns `false` with an
39 //! error logged.
40 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:
41
42 //! \brief Retrieves the user’s preference for submitting crash reports to a
43 //! collection server.
44 //!
45 //! \param[out] enabled Whether crash reports should be uploaded.
46 //!
47 //! \return On success, returns `true`, otherwise returns `false` with an
48 //! 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.
49 virtual bool GetUploadsEnabled(bool* enabled) = 0;
50
51 //! \brief Sets the user’s preference for submitting crash reports to a
52 //! collection server.
53 //!
54 //! \param[in] enabled Whether crash reports should be uploaded.
55 //!
56 //! \return On success, returns `true`, otherwise returns `false` with an
57 //! error logged.
58 virtual bool SetUploadsEnabled(bool enabled) = 0;
59
60 //! \brief Retrieves the last time at which a report was attempted to be
61 //! uploaded.
62 //!
63 //! \param[out] time The last time at which a report was uploaded.
64 //!
65 //! \return On success, returns `true`, otherwise returns `false` with an
66 //! error logged.
67 virtual bool GetLastUploadAttemptTime(time_t* time) = 0;
68
69 //! \brief Sets the last time at which a report was attempted to be uploaded.
70 //!
71 //! This is only meant to be used internally by the CrashReportDatabase.
72 //!
73 //! \param[in] time The last time at which a report was uploaded.
74 //!
75 //! \return On success, returns `true`, otherwise returns `false` with an
76 //! error logged.
77 virtual bool SetLastUploadAttemptTime(time_t time) = 0;
78
79 protected:
80 Settings() {}
81 virtual ~Settings() {}
82
83 private:
84 DISALLOW_COPY_AND_ASSIGN(Settings);
85 };
86
87 } // namespace crashpad
88
89 #endif // CRASHPAD_CLIENT_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698