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

Unified Diff: chrome/browser/password_manager/native_backend_gnome_x.h

Issue 2196193002: Expanded GnomeKeyringLoader macros (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unnecessary null termination Created 4 years, 5 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: chrome/browser/password_manager/native_backend_gnome_x.h
diff --git a/chrome/browser/password_manager/native_backend_gnome_x.h b/chrome/browser/password_manager/native_backend_gnome_x.h
index 1502f66cb37636ba5afc2ab717ae16467fd29d37..7f4e073eef271e0da040e604336ac3fb9f6ef0c5 100644
--- a/chrome/browser/password_manager/native_backend_gnome_x.h
+++ b/chrome/browser/password_manager/native_backend_gnome_x.h
@@ -42,30 +42,22 @@ class GnomeKeyringLoader {
protected:
static bool LoadGnomeKeyring();
-// Call a given parameter with the name of each function we use from GNOME
-// Keyring. Make sure to adjust the unit test if you change these.
-// The list of functions is divided into those we plan to mock in the unittest,
-// and those which we use without mocking in the test.
-#define GNOME_KEYRING_FOR_EACH_MOCKED_FUNC(F) \
- F(is_available) \
- F(store_password) \
- F(delete_password) \
- F(find_items) \
- F(result_to_message)
-#define GNOME_KEYRING_FOR_EACH_NON_MOCKED_FUNC(F) \
- F(attribute_list_free) \
- F(attribute_list_new) \
- F(attribute_list_append_string) \
- F(attribute_list_append_uint32)
-#define GNOME_KEYRING_FOR_EACH_FUNC(F) \
- GNOME_KEYRING_FOR_EACH_NON_MOCKED_FUNC(F) \
- GNOME_KEYRING_FOR_EACH_MOCKED_FUNC(F)
-
-// Declare the actual function pointers that we'll use in client code.
-#define GNOME_KEYRING_DECLARE_POINTER(name) \
- static decltype(&::gnome_keyring_##name) gnome_keyring_##name;
- GNOME_KEYRING_FOR_EACH_FUNC(GNOME_KEYRING_DECLARE_POINTER)
-#undef GNOME_KEYRING_DECLARE_POINTER
+ // Declare the actual function pointers that we'll use in client code.
+ static decltype(&::gnome_keyring_is_available) gnome_keyring_is_available;
vasilii 2016/08/01 09:51:26 Do you deliberately reuse the same names?
cfroussios 2016/08/01 10:54:52 That's the names that the macros would produce. Ar
vasilii 2016/08/01 11:46:37 I'd use gnome_keyring_is_available_ptr. I'm totall
cfroussios 2016/08/01 14:31:04 I used ptr. I didn't get rid of the prefix, becaus
+ static decltype(&::gnome_keyring_store_password) gnome_keyring_store_password;
+ static decltype(
+ &::gnome_keyring_delete_password) gnome_keyring_delete_password;
+ static decltype(&::gnome_keyring_find_items) gnome_keyring_find_items;
+ static decltype(
+ &::gnome_keyring_result_to_message) gnome_keyring_result_to_message;
+ static decltype(
+ &::gnome_keyring_attribute_list_free) gnome_keyring_attribute_list_free;
+ static decltype(
+ &::gnome_keyring_attribute_list_new) gnome_keyring_attribute_list_new;
+ static decltype(&::gnome_keyring_attribute_list_append_string)
+ gnome_keyring_attribute_list_append_string;
+ static decltype(&::gnome_keyring_attribute_list_append_uint32)
+ gnome_keyring_attribute_list_append_uint32;
// Set to true if LoadGnomeKeyring() has already succeeded.
static bool keyring_loaded;

Powered by Google App Engine
This is Rietveld 408576698