Commit 3aadc6e4 authored by sky@chromium.org's avatar sky@chromium.org

Renames IViewManagerClient::OnConnectionEstablished

InterfaceImpl has a function of the same name.

BUG=none
TEST=none
R=ben@chromium.org

Review URL: https://codereview.chromium.org/291193012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272646 0039d316-1c4b-4281-b951-d872f2087c98
parent 0981210c
...@@ -516,7 +516,7 @@ void ViewManagerSynchronizer::SetViewContents(TransportViewId view_id, ...@@ -516,7 +516,7 @@ void ViewManagerSynchronizer::SetViewContents(TransportViewId view_id,
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// ViewManagerSynchronizer, IViewManagerClient implementation: // ViewManagerSynchronizer, IViewManagerClient implementation:
void ViewManagerSynchronizer::OnConnectionEstablished( void ViewManagerSynchronizer::OnViewManagerConnectionEstablished(
TransportConnectionId connection_id, TransportConnectionId connection_id,
TransportChangeId next_server_change_id, TransportChangeId next_server_change_id,
const Array<INode>& nodes) { const Array<INode>& nodes) {
......
...@@ -66,7 +66,7 @@ class ViewManagerSynchronizer : public IViewManagerClient { ...@@ -66,7 +66,7 @@ class ViewManagerSynchronizer : public IViewManagerClient {
typedef ScopedVector<ViewManagerTransaction> Transactions; typedef ScopedVector<ViewManagerTransaction> Transactions;
// Overridden from IViewManagerClient: // Overridden from IViewManagerClient:
virtual void OnConnectionEstablished( virtual void OnViewManagerConnectionEstablished(
TransportConnectionId connection_id, TransportConnectionId connection_id,
TransportChangeId next_server_change_id, TransportChangeId next_server_change_id,
const mojo::Array<INode>& nodes) OVERRIDE; const mojo::Array<INode>& nodes) OVERRIDE;
......
...@@ -101,9 +101,9 @@ interface IViewManagerClient { ...@@ -101,9 +101,9 @@ interface IViewManagerClient {
// that uniquely identifies this connection. |next_server_change_id| is the // that uniquely identifies this connection. |next_server_change_id| is the
// id of the next change the server is expecting. |nodes| are the nodes // id of the next change the server is expecting. |nodes| are the nodes
// parented to the root. // parented to the root.
OnConnectionEstablished(uint16 connection_id, OnViewManagerConnectionEstablished(uint16 connection_id,
uint32 next_server_change_id, uint32 next_server_change_id,
INode[] nodes); INode[] nodes);
// This is sent to clients when a change is made to the server that results // This is sent to clients when a change is made to the server that results
// in the |server_change_id| changing but the client isn't notified. This is // in the |server_change_id| changing but the client isn't notified. This is
......
...@@ -71,19 +71,6 @@ ViewManagerConnection::~ViewManagerConnection() { ...@@ -71,19 +71,6 @@ ViewManagerConnection::~ViewManagerConnection() {
root_node_manager_->RemoveConnection(this); root_node_manager_->RemoveConnection(this);
} }
void ViewManagerConnection::OnConnectionEstablished() {
DCHECK_EQ(0, id_); // Should only get OnConnectionEstablished() once.
id_ = root_node_manager_->GetAndAdvanceNextConnectionId();
root_node_manager_->AddConnection(this);
std::vector<const Node*> to_send;
GetUnknownNodesFrom(root_node_manager_->root(), &to_send);
AllocationScope allocation_scope;
client()->OnConnectionEstablished(
id_,
root_node_manager_->next_server_change_id(),
NodesToINodes(to_send));
}
const Node* ViewManagerConnection::GetNode(const NodeId& id) const { const Node* ViewManagerConnection::GetNode(const NodeId& id) const {
if (id_ == id.connection_id) { if (id_ == id.connection_id) {
NodeMap::const_iterator i = node_map_.find(id.node_id); NodeMap::const_iterator i = node_map_.find(id.node_id);
...@@ -424,7 +411,7 @@ bool ViewManagerConnection::ProcessSetRoots( ...@@ -424,7 +411,7 @@ bool ViewManagerConnection::ProcessSetRoots(
for (NodeIdSet::const_iterator i = roots_.begin(); i != roots_.end(); ++i) for (NodeIdSet::const_iterator i = roots_.begin(); i != roots_.end(); ++i)
GetUnknownNodesFrom(GetNode(NodeIdFromTransportId(*i)), &to_send); GetUnknownNodesFrom(GetNode(NodeIdFromTransportId(*i)), &to_send);
AllocationScope allocation_scope; AllocationScope allocation_scope;
client()->OnConnectionEstablished( client()->OnViewManagerConnectionEstablished(
id_, id_,
root_node_manager_->next_server_change_id(), root_node_manager_->next_server_change_id(),
NodesToINodes(to_send)); NodesToINodes(to_send));
...@@ -638,6 +625,19 @@ void ViewManagerConnection::OnNodeViewReplaced(const Node* node, ...@@ -638,6 +625,19 @@ void ViewManagerConnection::OnNodeViewReplaced(const Node* node,
root_node_manager_->ProcessNodeViewReplaced(node, new_view, old_view); root_node_manager_->ProcessNodeViewReplaced(node, new_view, old_view);
} }
void ViewManagerConnection::OnConnectionEstablished() {
DCHECK_EQ(0, id_); // Should only get OnConnectionEstablished() once.
id_ = root_node_manager_->GetAndAdvanceNextConnectionId();
root_node_manager_->AddConnection(this);
std::vector<const Node*> to_send;
GetUnknownNodesFrom(root_node_manager_->root(), &to_send);
AllocationScope allocation_scope;
client()->OnViewManagerConnectionEstablished(
id_,
root_node_manager_->next_server_change_id(),
NodesToINodes(to_send));
}
} // namespace service } // namespace service
} // namespace view_manager } // namespace view_manager
} // namespace mojo } // namespace mojo
...@@ -43,8 +43,6 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection ...@@ -43,8 +43,6 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection
ViewManagerConnection(RootNodeManager* root_node_manager); ViewManagerConnection(RootNodeManager* root_node_manager);
virtual ~ViewManagerConnection(); virtual ~ViewManagerConnection();
virtual void OnConnectionEstablished() MOJO_OVERRIDE;
TransportConnectionId id() const { return id_; } TransportConnectionId id() const { return id_; }
// Returns the Node with the specified id. // Returns the Node with the specified id.
...@@ -178,6 +176,9 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection ...@@ -178,6 +176,9 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection
const View* new_view, const View* new_view,
const View* old_view) OVERRIDE; const View* old_view) OVERRIDE;
// InterfaceImp overrides:
virtual void OnConnectionEstablished() MOJO_OVERRIDE;
RootNodeManager* root_node_manager_; RootNodeManager* root_node_manager_;
// Id of this connection as assigned by RootNodeManager. Assigned in // Id of this connection as assigned by RootNodeManager. Assigned in
......
...@@ -272,7 +272,7 @@ class ViewManagerClientImpl : public IViewManagerClient { ...@@ -272,7 +272,7 @@ class ViewManagerClientImpl : public IViewManagerClient {
private: private:
// IViewManagerClient overrides: // IViewManagerClient overrides:
virtual void OnConnectionEstablished( virtual void OnViewManagerConnectionEstablished(
TransportConnectionId connection_id, TransportConnectionId connection_id,
TransportChangeId next_server_change_id, TransportChangeId next_server_change_id,
const mojo::Array<INode>& nodes) OVERRIDE { const mojo::Array<INode>& nodes) OVERRIDE {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment