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

Unified Diff: mojo/application/content_handler_factory.cc

Issue 868463008: Remove Client relationship between mojo.Shell/mojo.Application (Closed) Base URL: git@github.com:domokit/mojo.git@app_impl_init
Patch Set: fix android Created 5 years, 11 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: mojo/application/content_handler_factory.cc
diff --git a/mojo/application/content_handler_factory.cc b/mojo/application/content_handler_factory.cc
index 4826ec48e8ac72771a4cff8b5e21363cd38bfa60..db8effd0ccf4512bf1d3b026f21a40ccd8cb2a7a 100644
--- a/mojo/application/content_handler_factory.cc
+++ b/mojo/application/content_handler_factory.cc
@@ -29,17 +29,18 @@ class ApplicationThread : public base::PlatformThread::Delegate {
scoped_refptr<base::MessageLoopProxy> handler_thread,
const base::Callback<void(ApplicationThread*)>& termination_callback,
ContentHandlerFactory::Delegate* handler_delegate,
- ShellPtr shell,
+ InterfaceRequest<Application> application_request,
URLResponsePtr response)
: handler_thread_(handler_thread),
termination_callback_(termination_callback),
handler_delegate_(handler_delegate),
- shell_(shell.Pass()),
+ application_request_(application_request.Pass()),
response_(response.Pass()) {}
private:
void ThreadMain() override {
- handler_delegate_->RunApplication(shell_.Pass(), response_.Pass());
+ handler_delegate_->RunApplication(application_request_.Pass(),
+ response_.Pass());
handler_thread_->PostTask(FROM_HERE,
base::Bind(termination_callback_, this));
}
@@ -47,7 +48,7 @@ class ApplicationThread : public base::PlatformThread::Delegate {
scoped_refptr<base::MessageLoopProxy> handler_thread_;
base::Callback<void(ApplicationThread*)> termination_callback_;
ContentHandlerFactory::Delegate* handler_delegate_;
- ShellPtr shell_;
+ InterfaceRequest<Application> application_request_;
URLResponsePtr response_;
DISALLOW_COPY_AND_ASSIGN(ApplicationThread);
@@ -71,15 +72,14 @@ class ContentHandlerImpl : public InterfaceImpl<ContentHandler> {
private:
// Overridden from ContentHandler:
- virtual void StartApplication(ShellPtr shell,
- URLResponsePtr response) override {
+ virtual void StartApplication(
+ InterfaceRequest<Application> application_request,
+ URLResponsePtr response) override {
ApplicationThread* thread = new ApplicationThread(
base::MessageLoopProxy::current(),
base::Bind(&ContentHandlerImpl::OnThreadEnd,
weak_factory_.GetWeakPtr()),
- delegate_,
- shell.Pass(),
- response.Pass());
+ delegate_, application_request.Pass(), response.Pass());
base::PlatformThreadHandle handle;
bool launched = base::PlatformThread::Create(0, thread, &handle);
DCHECK(launched);
@@ -111,10 +111,11 @@ ContentHandlerFactory::~ContentHandlerFactory() {
}
void ContentHandlerFactory::ManagedDelegate::RunApplication(
- ShellPtr shell,
+ InterfaceRequest<Application> application_request,
URLResponsePtr response) {
base::MessageLoop loop(common::MessagePumpMojo::Create());
- auto application = this->CreateApplication(shell.Pass(), response.Pass());
+ auto application =
+ this->CreateApplication(application_request.Pass(), response.Pass());
if (application)
loop.Run();
}

Powered by Google App Engine
This is Rietveld 408576698