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

Unified Diff: services/util/cpp/factory_service_base.h

Issue 2010283006: Almost done: ApplicationDelegate -> ApplicationImplBase conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@work798-x-work797-x-work796_no_run_main_app
Patch Set: rebased 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
« no previous file with comments | « services/ui/view_manager/view_associate_table.h ('k') | services/util/cpp/factory_service_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/util/cpp/factory_service_base.h
diff --git a/services/util/cpp/factory_service_base.h b/services/util/cpp/factory_service_base.h
index 33b46e783cdf91d30d6e27bed6c1a8c216cbcadb..4098a43e3225216d25fc91e910e3eb8803e66cc3 100644
--- a/services/util/cpp/factory_service_base.h
+++ b/services/util/cpp/factory_service_base.h
@@ -9,13 +9,12 @@
#include <unordered_set>
#include "base/logging.h"
-#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/application/application_impl_base.h"
namespace mojo {
namespace util {
-class FactoryServiceBase : public ApplicationDelegate {
+class FactoryServiceBase : public ApplicationImplBase {
public:
// Provides common behavior for all objects created by the factory service.
class ProductBase : public std::enable_shared_from_this<ProductBase> {
@@ -23,13 +22,10 @@ class FactoryServiceBase : public ApplicationDelegate {
virtual ~ProductBase();
protected:
- ProductBase(FactoryServiceBase* owner);
+ explicit ProductBase(FactoryServiceBase* owner);
- // Returns the ApplicationImpl.
- ApplicationImpl* app() {
- DCHECK(owner_->app());
- return owner_->app();
- }
+ // Returns the owner.
+ FactoryServiceBase* owner() { return owner_; }
// Tells the factory service to release this product.
void ReleaseFromOwner() {
@@ -72,11 +68,6 @@ class FactoryServiceBase : public ApplicationDelegate {
~FactoryServiceBase() override;
- ApplicationImpl* app() { return app_; }
-
- // ApplicationDelegate implementation.
- void Initialize(ApplicationImpl* app) override;
-
protected:
template <typename ProductImpl>
void AddProduct(std::shared_ptr<ProductImpl> product) {
@@ -84,7 +75,6 @@ class FactoryServiceBase : public ApplicationDelegate {
}
private:
- ApplicationImpl* app_;
std::unordered_set<std::shared_ptr<ProductBase>> products_;
};
« no previous file with comments | « services/ui/view_manager/view_associate_table.h ('k') | services/util/cpp/factory_service_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698