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

Unified Diff: mojo/ui/content_viewer_app.cc

Issue 2020453003: Convert ViewProviderApp and ContentViewerApp to implement ApplicationImplBase instead of Applicatio… (Closed) Base URL: https://github.com/domokit/mojo.git@work796_no_run_main_app
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
« no previous file with comments | « mojo/ui/content_viewer_app.h ('k') | mojo/ui/view_provider_app.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/ui/content_viewer_app.cc
diff --git a/mojo/ui/content_viewer_app.cc b/mojo/ui/content_viewer_app.cc
index 0ede5d2ecbc7b62a3d8aaf20b2bc76781d98b50f..21bb266caee1934db1915356bad8cb2778d6005c 100644
--- a/mojo/ui/content_viewer_app.cc
+++ b/mojo/ui/content_viewer_app.cc
@@ -6,6 +6,8 @@
#include "base/command_line.h"
#include "base/logging.h"
+#include "mojo/public/cpp/application/service_provider_impl.h"
+#include "mojo/ui/view_provider_app.h"
namespace mojo {
namespace ui {
@@ -37,17 +39,15 @@ ContentViewerApp::ContentViewerApp() {}
ContentViewerApp::~ContentViewerApp() {}
-void ContentViewerApp::Initialize(mojo::ApplicationImpl* app_impl) {
- app_impl_ = app_impl;
-
+void ContentViewerApp::OnInitialize() {
auto command_line = base::CommandLine::ForCurrentProcess();
- command_line->InitFromArgv(app_impl_->args());
+ command_line->InitFromArgv(args());
logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
logging::InitLogging(settings);
}
-bool ContentViewerApp::ConfigureIncomingConnection(
+bool ContentViewerApp::OnAcceptConnection(
ServiceProviderImpl* service_provider_impl) {
service_provider_impl->AddService<ContentHandler>([this](
const ConnectionContext& connection_context,
@@ -63,12 +63,13 @@ void ContentViewerApp::StartViewer(
const std::string& content_handler_url,
mojo::InterfaceRequest<mojo::Application> application_request,
mojo::URLResponsePtr response) {
+ // TODO(vtl): This is usually leaky, since |*app| (the returned
+ // |ApplicationImplBase|/|ViewProviderApp| implementation) typically doesn't
+ // own itself. Probably |LoadContent()| should take the |application_request|,
+ // and not return anything. This method doesn't really appear to add anything.
ViewProviderApp* app = LoadContent(content_handler_url, response.Pass());
- if (app) {
- // TODO(vtl): This is leaky, since |ApplicationImpl| doesn't own itself.
- // (Also, who owns |*app|?)
- new mojo::ApplicationImpl(app, application_request.Pass());
- }
+ if (app)
+ app->Bind(application_request.Pass());
}
} // namespace ui
« no previous file with comments | « mojo/ui/content_viewer_app.h ('k') | mojo/ui/view_provider_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698