Chromium Code Reviews| Index: mojo/shell/ui_service_loader_android.cc |
| diff --git a/mojo/shell/ui_service_loader_android.cc b/mojo/shell/ui_service_loader_android.cc |
| index 3960858c2f73ad165f980c1ebd6799c3e802d4ad..78c968ad8339eeaa4e84a25ef6d694ad5dc601f5 100644 |
| --- a/mojo/shell/ui_service_loader_android.cc |
| +++ b/mojo/shell/ui_service_loader_android.cc |
| @@ -18,7 +18,9 @@ class UIServiceLoader::UILoader { |
| void LoadService(ServiceManager* manager, |
| const GURL& url, |
| ScopedMessagePipeHandle shell_handle) { |
| - loader_->LoadService(manager, url, shell_handle.Pass()); |
| + scoped_refptr<LoadServiceCallbacks> callbacks( |
| + new ServiceLoader::SimpleLoadServiceCallbacks(shell_handle.Pass())); |
| + loader_->LoadService(manager, url, callbacks); |
| } |
| void OnServiceError(ServiceManager* manager, const GURL& url) { |
| @@ -42,9 +44,14 @@ UIServiceLoader::~UIServiceLoader() { |
| base::Bind(&UIServiceLoader::ShutdownOnUIThread, base::Unretained(this))); |
| } |
| -void UIServiceLoader::LoadService(ServiceManager* manager, |
| - const GURL& url, |
| - ScopedMessagePipeHandle shell_handle) { |
| +void UIServiceLoader::LoadService( |
| + ServiceManager* manager, |
| + const GURL& url, |
| + scoped_refptr<LoadServiceCallbacks> callbacks) { |
| + ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); |
| + if (!shell_handle.is_valid()) { |
|
DaveMoore
2014/08/04 21:50:52
Nit: no braces
Aaron Boodman
2014/08/05 05:44:55
Done.
|
| + return; |
| + } |
| context_->ui_loop()->PostTask( |
| FROM_HERE, |
| base::Bind( |
| @@ -52,7 +59,7 @@ void UIServiceLoader::LoadService(ServiceManager* manager, |
| base::Unretained(this), |
| manager, |
| url, |
| - base::Owned(new ScopedMessagePipeHandle(shell_handle.Pass())))); |
| + shell_handle.Pass())); |
| } |
| void UIServiceLoader::OnServiceError(ServiceManager* manager, const GURL& url) { |
| @@ -67,10 +74,10 @@ void UIServiceLoader::OnServiceError(ServiceManager* manager, const GURL& url) { |
| void UIServiceLoader::LoadServiceOnUIThread( |
| ServiceManager* manager, |
| const GURL& url, |
| - ScopedMessagePipeHandle* shell_handle) { |
| + ScopedMessagePipeHandle shell_handle) { |
| if (!ui_loader_) |
| ui_loader_ = new UILoader(loader_.get()); |
| - ui_loader_->LoadService(manager, url, shell_handle->Pass()); |
| + ui_loader_->LoadService(manager, url, shell_handle.Pass()); |
| } |
| void UIServiceLoader::OnServiceErrorOnUIThread(ServiceManager* manager, |