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

Unified Diff: mojo/services/view_manager/root_node_manager.cc

Issue 308803002: Change type of interface created by mojo:view_manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup 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
« no previous file with comments | « mojo/services/view_manager/root_node_manager.h ('k') | mojo/services/view_manager/root_view_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/root_node_manager.cc
diff --git a/mojo/services/view_manager/root_node_manager.cc b/mojo/services/view_manager/root_node_manager.cc
index 37cda55d3d2098ad2992392d69680c65491537e5..b88e1a3108c058a7adf6e7e9a99d2ad9e8edc9bd 100644
--- a/mojo/services/view_manager/root_node_manager.cc
+++ b/mojo/services/view_manager/root_node_manager.cc
@@ -33,15 +33,17 @@ RootNodeManager::Context::Context() {
}
RootNodeManager::Context::~Context() {
+ aura::Env::DeleteInstance();
}
-RootNodeManager::RootNodeManager(ServiceProvider* service_provider)
+RootNodeManager::RootNodeManager(ServiceProvider* service_provider,
+ RootViewManagerDelegate* view_manager_delegate)
: service_provider_(service_provider),
next_connection_id_(1),
next_server_change_id_(1),
change_source_(kRootConnection),
is_processing_delete_node_(false),
- root_view_manager_(service_provider, this),
+ root_view_manager_(service_provider, this, view_manager_delegate),
root_(this, RootNodeId()) {
}
@@ -68,14 +70,16 @@ void RootNodeManager::RemoveConnection(ViewManagerConnection* connection) {
connections_created_by_connect_.erase(connection);
}
+void RootNodeManager::InitialConnect(const std::string& url) {
+ CHECK(connection_map_.empty());
+ Array<TransportNodeId> roots(0);
+ ConnectImpl(String::From(url), roots);
+}
+
void RootNodeManager::Connect(const String& url,
const Array<TransportNodeId>& node_ids) {
- MessagePipe pipe;
- service_provider_->ConnectToService(url, pipe.handle1.Pass());
- ViewManagerConnection* connection = new ViewManagerConnection(this);
- connection->SetRoots(node_ids);
- BindToPipe(connection, pipe.handle0.Pass());
- connections_created_by_connect_.insert(connection);
+ CHECK_GT(node_ids.size(), 0u);
+ ConnectImpl(url, node_ids)->set_delete_on_connection_error();
}
ViewManagerConnection* RootNodeManager::GetConnection(
@@ -159,6 +163,18 @@ void RootNodeManager::FinishChange(ChangeType change_type) {
next_server_change_id_++;
}
+ViewManagerConnection* RootNodeManager::ConnectImpl(
+ const String& url,
+ const Array<TransportNodeId>& node_ids) {
+ MessagePipe pipe;
+ service_provider_->ConnectToService(url, pipe.handle1.Pass());
+ ViewManagerConnection* connection = new ViewManagerConnection(this);
+ connection->SetRoots(node_ids);
+ BindToPipe(connection, pipe.handle0.Pass());
+ connections_created_by_connect_.insert(connection);
+ return connection;
+}
+
void RootNodeManager::OnNodeHierarchyChanged(const Node* node,
const Node* new_parent,
const Node* old_parent) {
« no previous file with comments | « mojo/services/view_manager/root_node_manager.h ('k') | mojo/services/view_manager/root_view_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698