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

Unified Diff: mojo/shell/app_child_process.cc

Issue 265793015: Mojo: Replace RemotePtr with InterfacePtr and InterfaceImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: snapshot Created 6 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
Index: mojo/shell/app_child_process.cc
diff --git a/mojo/shell/app_child_process.cc b/mojo/shell/app_child_process.cc
index 7909d83da23d502a4891c9662e6e58cb1ff64cfc..9800572c2811dfe2249268216df93f81b538458d 100644
--- a/mojo/shell/app_child_process.cc
+++ b/mojo/shell/app_child_process.cc
@@ -20,7 +20,6 @@
#include "base/threading/thread_checker.h"
#include "mojo/common/message_pump_mojo.h"
#include "mojo/embedder/embedder.h"
-#include "mojo/public/cpp/bindings/remote_ptr.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/shell/app_child_process.mojom.h"
@@ -145,7 +144,7 @@ class AppContext {
// AppChildControllerImpl ------------------------------------------------------
-class AppChildControllerImpl : public mojo_shell::AppChildController {
+class AppChildControllerImpl : public AppChildController {
public:
virtual ~AppChildControllerImpl() {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -161,6 +160,8 @@ class AppChildControllerImpl : public mojo_shell::AppChildController {
DCHECK(platform_channel.is_valid());
DCHECK(!app_context->controller());
+ // XXX need to use a AppChildControllerPtr here initialized with
+ // AppChildControllerImpl.
app_context->set_controller(
make_scoped_ptr(new AppChildControllerImpl(app_context, unblocker)));
app_context->controller()->CreateChannel(platform_channel.Pass());
@@ -179,13 +180,19 @@ class AppChildControllerImpl : public mojo_shell::AppChildController {
app_context_->set_controller(scoped_ptr<AppChildControllerImpl>());
}
- // |AppChildController| method:
+ // |AppChildController| methods:
+
+ virtual void SetClient(AppChildControllerClient* client) {
+ controller_client_ = client;
+ }
+
virtual void StartApp(const String& app_path,
ScopedMessagePipeHandle service) OVERRIDE {
DVLOG(2) << "AppChildControllerImpl::StartApp("
<< app_path.To<std::string>() << ", ...)";
DCHECK(thread_checker_.CalledOnValidThread());
+ // TODO(darin): Add TypeConverter for FilePath <-> mojo::String.
unblocker_.Unblock(base::Bind(&AppChildControllerImpl::StartAppOnMainThread,
base::FilePath::FromUTF8Unsafe(
app_path.To<std::string>()),
@@ -197,6 +204,7 @@ class AppChildControllerImpl : public mojo_shell::AppChildController {
const Blocker::Unblocker& unblocker)
: app_context_(app_context),
unblocker_(unblocker),
+ controller_client_(NULL),
channel_info_(NULL) {
}
@@ -211,8 +219,8 @@ class AppChildControllerImpl : public mojo_shell::AppChildController {
base::Unretained(this)),
base::MessageLoopProxy::current()));
controller_client_.reset(
- mojo_shell::ScopedAppChildControllerClientHandle(
- mojo_shell::AppChildControllerClientHandle(
+ ScopedAppChildControllerClientHandle(
+ AppChildControllerClientHandle(
host_message_pipe.release().value())), this);
}
@@ -262,7 +270,7 @@ class AppChildControllerImpl : public mojo_shell::AppChildController {
AppContext* const app_context_;
Blocker::Unblocker unblocker_;
- RemotePtr<mojo_shell::AppChildControllerClient> controller_client_;
+ AppChildControllerClient* controller_client_;
embedder::ChannelInfo* channel_info_;
DISALLOW_COPY_AND_ASSIGN(AppChildControllerImpl);

Powered by Google App Engine
This is Rietveld 408576698