| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/application/content_handler_factory.h" | 5 #include "mojo/application/content_handler_factory.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 108 } |
| 109 | 109 |
| 110 ContentHandlerFactory::~ContentHandlerFactory() { | 110 ContentHandlerFactory::~ContentHandlerFactory() { |
| 111 } | 111 } |
| 112 | 112 |
| 113 void ContentHandlerFactory::ManagedDelegate::RunApplication( | 113 void ContentHandlerFactory::ManagedDelegate::RunApplication( |
| 114 ShellPtr shell, | 114 ShellPtr shell, |
| 115 URLResponsePtr response) { | 115 URLResponsePtr response) { |
| 116 base::MessageLoop loop(common::MessagePumpMojo::Create()); | 116 base::MessageLoop loop(common::MessagePumpMojo::Create()); |
| 117 auto application = this->CreateApplication(shell.Pass(), response.Pass()); | 117 auto application = this->CreateApplication(shell.Pass(), response.Pass()); |
| 118 loop.Run(); | 118 if (application) |
| 119 loop.Run(); |
| 119 } | 120 } |
| 120 | 121 |
| 121 void ContentHandlerFactory::Create(ApplicationConnection* connection, | 122 void ContentHandlerFactory::Create(ApplicationConnection* connection, |
| 122 InterfaceRequest<ContentHandler> request) { | 123 InterfaceRequest<ContentHandler> request) { |
| 123 BindToRequest(new ContentHandlerImpl(delegate_), &request); | 124 BindToRequest(new ContentHandlerImpl(delegate_), &request); |
| 124 } | 125 } |
| 125 | 126 |
| 126 } // namespace mojo | 127 } // namespace mojo |
| OLD | NEW |