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

Side by Side Diff: trunk/src/mojo/services/view_manager/root_node_manager.cc

Issue 286653003: Revert 270122 "Synchronizes View instances across clients." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/services/view_manager/root_node_manager.h" 5 #include "mojo/services/view_manager/root_node_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/services/view_manager/view_manager_connection.h" 8 #include "mojo/services/view_manager/view_manager_connection.h"
9 #include "ui/aura/env.h" 9 #include "ui/aura/env.h"
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 void RootNodeManager::NotifyNodeDeleted(const NodeId& node) { 110 void RootNodeManager::NotifyNodeDeleted(const NodeId& node) {
111 // TODO(sky): make a macro for this. 111 // TODO(sky): make a macro for this.
112 for (ConnectionMap::iterator i = connection_map_.begin(); 112 for (ConnectionMap::iterator i = connection_map_.begin();
113 i != connection_map_.end(); ++i) { 113 i != connection_map_.end(); ++i) {
114 i->second->NotifyNodeDeleted(node, next_server_change_id_, 114 i->second->NotifyNodeDeleted(node, next_server_change_id_,
115 GetClientChangeId(i->first)); 115 GetClientChangeId(i->first));
116 } 116 }
117 } 117 }
118 118
119 void RootNodeManager::NotifyViewDeleted(const ViewId& view) {
120 // TODO(sky): make a macro for this.
121 for (ConnectionMap::iterator i = connection_map_.begin();
122 i != connection_map_.end(); ++i) {
123 i->second->NotifyViewDeleted(view, next_server_change_id_,
124 GetClientChangeId(i->first));
125 }
126 }
127
128 void RootNodeManager::PrepareForChange(ViewManagerConnection* connection, 119 void RootNodeManager::PrepareForChange(ViewManagerConnection* connection,
129 TransportChangeId change_id) { 120 TransportChangeId change_id) {
130 DCHECK(!change_.get()); // Should only ever have one change in flight. 121 DCHECK(!change_.get()); // Should only ever have one change in flight.
131 change_.reset(new Change(connection->id(), change_id)); 122 change_.reset(new Change(connection->id(), change_id));
132 } 123 }
133 124
134 void RootNodeManager::FinishChange(ChangeType change_type) { 125 void RootNodeManager::FinishChange(ChangeType change_type) {
135 DCHECK(change_.get()); // PrepareForChange/FinishChange should be balanced. 126 DCHECK(change_.get()); // PrepareForChange/FinishChange should be balanced.
136 change_.reset(); 127 change_.reset();
137 if (change_type == CHANGE_TYPE_ADVANCE_SERVER_CHANGE_ID) 128 if (change_type == CHANGE_TYPE_ADVANCE_SERVER_CHANGE_ID)
(...skipping 15 matching lines...) Expand all
153 144
154 void RootNodeManager::OnNodeViewReplaced(const NodeId& node, 145 void RootNodeManager::OnNodeViewReplaced(const NodeId& node,
155 const ViewId& new_view_id, 146 const ViewId& new_view_id,
156 const ViewId& old_view_id) { 147 const ViewId& old_view_id) {
157 NotifyNodeViewReplaced(node, new_view_id, old_view_id); 148 NotifyNodeViewReplaced(node, new_view_id, old_view_id);
158 } 149 }
159 150
160 } // namespace view_manager 151 } // namespace view_manager
161 } // namespace services 152 } // namespace services
162 } // namespace mojo 153 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698