OLD | NEW |
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/public/cpp/view_manager/lib/view_manager_synchronizer.h" | 5 #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "mojo/public/cpp/application/connect.h" | 9 #include "mojo/public/cpp/application/connect.h" |
10 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | 10 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 public: | 227 public: |
228 DestroyViewTreeNodeTransaction(TransportNodeId node_id, | 228 DestroyViewTreeNodeTransaction(TransportNodeId node_id, |
229 ViewManagerSynchronizer* synchronizer) | 229 ViewManagerSynchronizer* synchronizer) |
230 : ViewManagerTransaction(TYPE_DESTROY_VIEW_TREE_NODE, synchronizer), | 230 : ViewManagerTransaction(TYPE_DESTROY_VIEW_TREE_NODE, synchronizer), |
231 node_id_(node_id) {} | 231 node_id_(node_id) {} |
232 virtual ~DestroyViewTreeNodeTransaction() {} | 232 virtual ~DestroyViewTreeNodeTransaction() {} |
233 | 233 |
234 private: | 234 private: |
235 // Overridden from ViewManagerTransaction: | 235 // Overridden from ViewManagerTransaction: |
236 virtual void DoCommit() OVERRIDE { | 236 virtual void DoCommit() OVERRIDE { |
| 237 GetAndAdvanceNextServerChangeId(); |
237 service()->DeleteNode(node_id_, ActionCompletedCallback()); | 238 service()->DeleteNode(node_id_, ActionCompletedCallback()); |
238 } | 239 } |
239 virtual void DoActionCompleted(bool success) OVERRIDE { | 240 virtual void DoActionCompleted(bool success) OVERRIDE { |
240 // TODO(beng): recovery? | 241 // TODO(beng): recovery? |
241 } | 242 } |
242 | 243 |
243 const TransportNodeId node_id_; | 244 const TransportNodeId node_id_; |
244 DISALLOW_COPY_AND_ASSIGN(DestroyViewTreeNodeTransaction); | 245 DISALLOW_COPY_AND_ASSIGN(DestroyViewTreeNodeTransaction); |
245 }; | 246 }; |
246 | 247 |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 void ViewManagerSynchronizer::RemoveFromPendingQueue( | 672 void ViewManagerSynchronizer::RemoveFromPendingQueue( |
672 ViewManagerTransaction* transaction) { | 673 ViewManagerTransaction* transaction) { |
673 DCHECK_EQ(transaction, pending_transactions_.front()); | 674 DCHECK_EQ(transaction, pending_transactions_.front()); |
674 pending_transactions_.erase(pending_transactions_.begin()); | 675 pending_transactions_.erase(pending_transactions_.begin()); |
675 if (pending_transactions_.empty() && !changes_acked_callback_.is_null()) | 676 if (pending_transactions_.empty() && !changes_acked_callback_.is_null()) |
676 changes_acked_callback_.Run(); | 677 changes_acked_callback_.Run(); |
677 } | 678 } |
678 | 679 |
679 } // namespace view_manager | 680 } // namespace view_manager |
680 } // namespace mojo | 681 } // namespace mojo |
OLD | NEW |