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

Unified Diff: mojo/shell/ui_service_loader_android.cc

Issue 423963004: First cut at "content handling" support in Mojo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blech Created 6 years, 4 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/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..78d756d0ae4e23503518fa4ef602b7f39fd438f0 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,13 @@ 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())
+ return;
context_->ui_loop()->PostTask(
FROM_HERE,
base::Bind(
@@ -52,7 +58,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 +73,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,

Powered by Google App Engine
This is Rietveld 408576698