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

Side by Side Diff: service.h

Issue 2645008: Update on feedback, update dbus API, add unit tests. TEST=manual,unit,BVT BUG=3628 323 (Closed) Base URL: ssh://git@chromiumos-git/cryptohome.git
Patch Set: Address second round of feedback. Created 10 years, 6 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
« no previous file with comments | « secure_blob_unittest.cc ('k') | service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #ifndef CRYPTOHOME_SERVICE_H_ 4 #ifndef CRYPTOHOME_SERVICE_H_
5 #define CRYPTOHOME_SERVICE_H_ 5 #define CRYPTOHOME_SERVICE_H_
6 6
7 #include <dbus/dbus-glib.h>
8 #include <glib-object.h>
9
10 #include <base/logging.h> 7 #include <base/logging.h>
8 #include <base/scoped_ptr.h>
11 #include <chromeos/dbus/abstract_dbus_service.h> 9 #include <chromeos/dbus/abstract_dbus_service.h>
12 #include <chromeos/dbus/dbus.h> 10 #include <chromeos/dbus/dbus.h>
13 #include <chromeos/dbus/service_constants.h> 11 #include <chromeos/dbus/service_constants.h>
14 #include <chromeos/glib/object.h> 12 #include <chromeos/glib/object.h>
13 #include <dbus/dbus-glib.h>
14 #include <glib-object.h>
15 15
16 #include "cryptohome/mount.h" 16 #include "mount.h"
17 17
18 namespace cryptohome { 18 namespace cryptohome {
19 namespace gobject { 19 namespace gobject {
20
20 struct Cryptohome; 21 struct Cryptohome;
21 } // namespace gobject 22 } // namespace gobject
22 23
23 // Service 24 // Service
24 // Provides a wrapper for exporting CryptohomeInterface to 25 // Provides a wrapper for exporting CryptohomeInterface to
25 // D-Bus and entering the glib run loop. 26 // D-Bus and entering the glib run loop.
26 // 27 //
27 // ::g_type_init() must be called before this class is used. 28 // ::g_type_init() must be called before this class is used.
28 // 29 //
29 // TODO(wad) make an AbstractDbusService class which wraps a placeholder 30 // TODO(wad) make an AbstractDbusService class which wraps a placeholder
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 gchar *to_key, 65 gchar *to_key,
65 gboolean *OUT_success, 66 gboolean *OUT_success,
66 GError **error); 67 GError **error);
67 virtual gboolean Remove(gchar *user, 68 virtual gboolean Remove(gchar *user,
68 gboolean *OUT_success, 69 gboolean *OUT_success,
69 GError **error); 70 GError **error);
70 virtual gboolean GetSystemSalt(GArray **OUT_salt, GError **error); 71 virtual gboolean GetSystemSalt(GArray **OUT_salt, GError **error);
71 virtual gboolean IsMounted(gboolean *OUT_is_mounted, GError **error); 72 virtual gboolean IsMounted(gboolean *OUT_is_mounted, GError **error);
72 virtual gboolean Mount(gchar *user, 73 virtual gboolean Mount(gchar *user,
73 gchar *key, 74 gchar *key,
75 gint *OUT_error,
74 gboolean *OUT_done, 76 gboolean *OUT_done,
75 GError **error); 77 GError **error);
78 virtual gboolean MountGuest(gint *OUT_error,
79 gboolean *OUT_done,
80 GError **error);
76 virtual gboolean Unmount(gboolean *OUT_done, GError **error); 81 virtual gboolean Unmount(gboolean *OUT_done, GError **error);
77 82
78 protected: 83 protected:
79 virtual GMainLoop *main_loop() { return loop_; } 84 virtual GMainLoop *main_loop() { return loop_; }
80 85
81 private: 86 private:
82 GMainLoop *loop_; 87 GMainLoop *loop_;
83 // Can't use scoped_ptr for cryptohome_ because memory is allocated by glib. 88 // Can't use scoped_ptr for cryptohome_ because memory is allocated by glib.
84 gobject::Cryptohome *cryptohome_; 89 gobject::Cryptohome *cryptohome_;
85 chromeos::Blob system_salt_; 90 chromeos::Blob system_salt_;
91 scoped_ptr<cryptohome::Mount> default_mount_;
86 cryptohome::Mount* mount_; 92 cryptohome::Mount* mount_;
87 DISALLOW_COPY_AND_ASSIGN(Service); 93 DISALLOW_COPY_AND_ASSIGN(Service);
88 }; 94 };
89 95
90 } // cryptohome 96 } // namespace cryptohome
97
91 #endif // CRYPTOHOME_SERVICE_H_ 98 #endif // CRYPTOHOME_SERVICE_H_
OLDNEW
« no previous file with comments | « secure_blob_unittest.cc ('k') | service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698