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

Unified Diff: services/authentication/main.cc

Issue 1981513002: ApplicationConnection devolution, part 2.2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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: services/authentication/main.cc
diff --git a/services/authentication/main.cc b/services/authentication/main.cc
index bedd607795e4bff1ef69e36f86738e8e91b95650..dc17369a6d56fc9460c8f27f7241ca7d9d72b53a 100644
--- a/services/authentication/main.cc
+++ b/services/authentication/main.cc
@@ -9,7 +9,6 @@
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/connect.h"
-#include "mojo/public/cpp/application/interface_factory.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/services/authentication/interfaces/authentication.mojom.h"
@@ -18,9 +17,7 @@
namespace authentication {
-class GoogleAccountManagerApp
- : public mojo::ApplicationDelegate,
- public mojo::InterfaceFactory<AuthenticationService> {
+class GoogleAccountManagerApp : public mojo::ApplicationDelegate {
public:
GoogleAccountManagerApp() {}
~GoogleAccountManagerApp() override {}
@@ -35,24 +32,23 @@ class GoogleAccountManagerApp
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override {
- connection->AddService<AuthenticationService>(this);
+ connection->GetServiceProviderImpl().AddService<AuthenticationService>(
+ [this](const mojo::ConnectionContext& connection_context,
+ mojo::InterfaceRequest<AuthenticationService> request) {
+ mojo::files::Error error = mojo::files::Error::INTERNAL;
+ mojo::files::DirectoryPtr directory;
+ files_->OpenFileSystem("app_persistent_cache", GetProxy(&directory),
+ [&error](mojo::files::Error e) { error = e; });
+ CHECK(files_.WaitForIncomingResponse());
+ if (mojo::files::Error::OK != error) {
+ LOG(FATAL) << "Unable to initialize accounts DB";
+ }
+ new authentication::GoogleAuthenticationServiceImpl(
+ request.Pass(), app_url_, network_service_, directory);
+ });
return true;
}
- void Create(const mojo::ConnectionContext& connection_context,
- mojo::InterfaceRequest<AuthenticationService> request) override {
- mojo::files::Error error = mojo::files::Error::INTERNAL;
- mojo::files::DirectoryPtr directory;
- files_->OpenFileSystem("app_persistent_cache", GetProxy(&directory),
- [&error](mojo::files::Error e) { error = e; });
- CHECK(files_.WaitForIncomingResponse());
- if (mojo::files::Error::OK != error) {
- LOG(FATAL) << "Unable to initialize accounts DB";
- }
- new authentication::GoogleAuthenticationServiceImpl(
- request.Pass(), app_url_, network_service_, directory);
- }
-
private:
mojo::NetworkServicePtr network_service_;
mojo::files::FilesPtr files_;

Powered by Google App Engine
This is Rietveld 408576698