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

Unified Diff: services/authentication/accounts_db_manager.h

Issue 1466733002: Google OAuth Device Flow support for FNL (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: updated demo namespaces Created 5 years 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: services/authentication/accounts_db_manager.h
diff --git a/services/native_support/process_test_base.h b/services/authentication/accounts_db_manager.h
similarity index 53%
copy from services/native_support/process_test_base.h
copy to services/authentication/accounts_db_manager.h
index 6b7900d41199ccf599c00946fb91642e2ad1666d..ca7a7f92c49e522181e6334fb2f34d7dcc7f862f 100644
--- a/services/native_support/process_test_base.h
+++ b/services/authentication/accounts_db_manager.h
@@ -2,18 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef SERVICES_NATIVE_SUPPORT_PROCESS_TEST_BASE_H_
-#define SERVICES_NATIVE_SUPPORT_PROCESS_TEST_BASE_H_
+#ifndef SERVICES_AUTHENTICATION_ACCOUNTS_DB_MANAGER_H_
+#define SERVICES_AUTHENTICATION_ACCOUNTS_DB_MANAGER_H_
#include <type_traits>
#include "base/macros.h"
-#include "mojo/public/cpp/application/application_test_base.h"
-#include "mojo/services/native_support/interfaces/process.mojom.h"
+#include "mojo/services/files/interfaces/files.mojom.h"
-namespace native_support {
+namespace authentication {
-// TODO(vtl): Stuff copied from mojo/public/cpp/bindings/lib/template_util.h.
+// TODO(ukode): Stuff copied from mojo/public/cpp/bindings/lib/template_util.h.
jln (very slow on Chromium) 2015/12/08 22:27:29 This should definitely not be in this .h file. If
ukode 2015/12/16 19:24:13 Acknowledged. +Vtl
typedef char YesType;
struct NoType {
@@ -41,7 +40,7 @@ template <typename T>
typename std::enable_if<IsMoveOnlyType<T>::value, T>::type Forward(T& t) {
return t.Pass();
}
-// TODO(vtl): (End of stuff copied from template_util.h.)
+// TODO(ukode): (End of stuff copied from template_util.h.)
template <typename T1>
mojo::Callback<void(T1)> Capture(T1* t1) {
@@ -56,22 +55,26 @@ mojo::Callback<void(T1, T2)> Capture(T1* t1, T2* t2) {
};
}
-class ProcessTestBase : public mojo::test::ApplicationTestBase {
+class AccountsDbManager {
jln (very slow on Chromium) 2015/12/08 22:27:29 Please, document your class and methods as per sty
ukode 2015/12/16 19:24:13 Done.
public:
- ProcessTestBase();
- ~ProcessTestBase() override;
+ AccountsDbManager();
+ explicit AccountsDbManager(mojo::files::FilesPtr files);
+ ~AccountsDbManager();
- void SetUp() override;
-
- protected:
- ProcessPtr& process() { return process_; }
+ bool UpdateAccount(const mojo::String& username,
+ const mojo::String& account_data);
+ void GetAccountDataForUser(const mojo::String& username,
+ mojo::String& user_data);
+ mojo::Array<uint8_t> FetchAllAccounts();
private:
- ProcessPtr process_;
+ bool checkIfUserExists(const std::string& user_data);
jln (very slow on Chromium) 2015/12/08 22:27:29 This method looks unimplemented, no?
jln (very slow on Chromium) 2015/12/08 22:27:29 nit: Capital C in CheckIfUserExists)
ukode 2015/12/16 19:24:13 Good catch, Had it before, later removed it as it
ukode 2015/12/16 19:24:13 Done.
+ mojo::files::DirectoryPtr directory_;
jln (very slow on Chromium) 2015/12/08 22:27:29 Nit: vertical space
ukode 2015/12/16 19:24:13 Done.
+ std::string contents_;
- DISALLOW_COPY_AND_ASSIGN(ProcessTestBase);
+ DISALLOW_COPY_AND_ASSIGN(AccountsDbManager);
};
-} // namespace native_support
+} // namespace authentication
-#endif // SERVICES_NATIVE_SUPPORT_PROCESS_TEST_BASE_H_
+#endif // SERVICES_AUTHENTICATION_ACCOUNTS_DB_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698