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

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

Issue 397803003: Makes it so a node can only the root of one connection at a time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge again Created 6 years, 5 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/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 4da56aa339194b4b04e9fe73e7bca0471c1a2b80..1b19bf5a047203f7f302da871cfe5cca42cd2312 100644
--- a/mojo/services/view_manager/root_node_manager.cc
+++ b/mojo/services/view_manager/root_node_manager.cc
@@ -33,6 +33,10 @@ RootNodeManager::ScopedChange::~ScopedChange() {
root_->FinishChange();
}
+void RootNodeManager::ScopedChange::SendServerChangeIdAdvanced() {
+ root_->SendServerChangeIdAdvanced();
+}
+
RootNodeManager::Context::Context() {
// Pass in false as native viewport creates the PlatformEventSource.
aura::Env::CreateInstance(false);
@@ -141,6 +145,16 @@ ViewManagerServiceImpl* RootNodeManager::GetConnectionByCreator(
return NULL;
}
+ViewManagerServiceImpl* RootNodeManager::GetConnectionWithRoot(
+ const NodeId& id) {
+ for (ConnectionMap::const_iterator i = connection_map_.begin();
+ i != connection_map_.end(); ++i) {
+ if (i->second->HasRoot(id))
+ return i->second;
+ }
+ return NULL;
+}
+
void RootNodeManager::DispatchViewInputEventToWindowManager(
const View* view,
const ui::Event* event) {
@@ -236,6 +250,15 @@ void RootNodeManager::FinishChange() {
current_change_ = NULL;
}
+void RootNodeManager::SendServerChangeIdAdvanced() {
+ CHECK(current_change_);
+ for (ConnectionMap::iterator i = connection_map_.begin();
+ i != connection_map_.end(); ++i) {
+ if (!DidConnectionMessageClient(i->first))
+ i->second->client()->OnServerChangeIdAdvanced(next_server_change_id_ + 1);
+ }
+}
+
ViewManagerServiceImpl* RootNodeManager::EmbedImpl(
const ConnectionSpecificId creator_id,
const String& url,
@@ -261,6 +284,7 @@ ViewManagerServiceImpl* RootNodeManager::EmbedImpl(
root_id);
BindToPipe(connection, pipe.handle0.Pass());
connections_created_by_connect_.insert(connection);
+ OnConnectionMessagedClient(connection->id());
return connection;
}
« no previous file with comments | « mojo/services/view_manager/root_node_manager.h ('k') | mojo/services/view_manager/view_manager_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698