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

Side by Side Diff: mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc

Issue 324753002: Fix ownership bug with ViewObserver::OnViewInputEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no pass Created 6 years, 6 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/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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 } 641 }
642 642
643 void ViewManagerSynchronizer::OnViewInputEvent( 643 void ViewManagerSynchronizer::OnViewInputEvent(
644 uint32_t view_id, 644 uint32_t view_id,
645 EventPtr event, 645 EventPtr event,
646 const Callback<void()>& ack_callback) { 646 const Callback<void()>& ack_callback) {
647 View* view = view_manager_->GetViewById(view_id); 647 View* view = view_manager_->GetViewById(view_id);
648 if (view) { 648 if (view) {
649 FOR_EACH_OBSERVER(ViewObserver, 649 FOR_EACH_OBSERVER(ViewObserver,
650 *ViewPrivate(view).observers(), 650 *ViewPrivate(view).observers(),
651 OnViewInputEvent(view, event.Pass())); 651 OnViewInputEvent(view, event));
652 } 652 }
653 ack_callback.Run(); 653 ack_callback.Run();
654 } 654 }
655 655
656 //////////////////////////////////////////////////////////////////////////////// 656 ////////////////////////////////////////////////////////////////////////////////
657 // ViewManagerSynchronizer, private: 657 // ViewManagerSynchronizer, private:
658 658
659 void ViewManagerSynchronizer::Sync() { 659 void ViewManagerSynchronizer::Sync() {
660 // The service connection may not be set up yet. OnConnectionEstablished() 660 // The service connection may not be set up yet. OnConnectionEstablished()
661 // will schedule another sync when it is. 661 // will schedule another sync when it is.
(...skipping 10 matching lines...) Expand all
672 void ViewManagerSynchronizer::RemoveFromPendingQueue( 672 void ViewManagerSynchronizer::RemoveFromPendingQueue(
673 ViewManagerTransaction* transaction) { 673 ViewManagerTransaction* transaction) {
674 DCHECK_EQ(transaction, pending_transactions_.front()); 674 DCHECK_EQ(transaction, pending_transactions_.front());
675 pending_transactions_.erase(pending_transactions_.begin()); 675 pending_transactions_.erase(pending_transactions_.begin());
676 if (pending_transactions_.empty() && !changes_acked_callback_.is_null()) 676 if (pending_transactions_.empty() && !changes_acked_callback_.is_null())
677 changes_acked_callback_.Run(); 677 changes_acked_callback_.Run();
678 } 678 }
679 679
680 } // namespace view_manager 680 } // namespace view_manager
681 } // namespace mojo 681 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/window_manager/window_manager.cc ('k') | mojo/services/public/cpp/view_manager/view_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698