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

Unified Diff: mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc

Issue 265793015: Mojo: Replace RemotePtr with InterfacePtr and InterfaceImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Force InterfaceImpl subclasses to implement OnConnectionError 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/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc b/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc
index 1f82fd80ab137e4a685f91ebd86f5801bf9a8afd..75263cc42842aa21f7d6177612925540359f24db 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc
@@ -7,7 +7,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
-#include "mojo/public/cpp/bindings/allocation_scope.h"
+#include "mojo/public/cpp/shell/service.h"
#include "mojo/public/interfaces/shell/shell.mojom.h"
#include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h"
#include "mojo/services/public/cpp/view_manager/lib/view_tree_node_private.h"
@@ -186,17 +186,16 @@ ViewManagerSynchronizer::ViewManagerSynchronizer(ViewManager* view_manager)
next_id_(1),
next_change_id_(0),
init_loop_(NULL) {
- InterfacePipe<services::view_manager::IViewManager, AnyInterface>
- view_manager_pipe;
+ ConnectTo(ViewManagerPrivate(view_manager_).shell(), "mojo:mojo_view_manager",
+ &service_);
+ service_->SetClient(this);
+
AllocationScope scope;
- MessagePipeHandle client_handle = view_manager_pipe.handle_to_peer.get();
- ViewManagerPrivate(view_manager_).shell()->Connect(
- "mojo:mojo_view_manager", view_manager_pipe.handle_to_peer.Pass());
- service_.reset(view_manager_pipe.handle_to_self.Pass(), this);
service_->GetNodeTree(
1,
base::Bind(&ViewManagerSynchronizer::OnRootTreeReceived,
base::Unretained(this)));
+
base::RunLoop loop;
init_loop_ = &loop;
init_loop_->Run();

Powered by Google App Engine
This is Rietveld 408576698