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

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

Issue 289063015: Mojo: Remove SetClient from generated interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/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/run_loop.h" 8 #include "base/run_loop.h"
9 #include "mojo/public/cpp/shell/connect.h" 9 #include "mojo/public/cpp/shell/connect.h"
10 #include "mojo/public/interfaces/shell/shell.mojom.h" 10 #include "mojo/public/interfaces/shell/shell.mojom.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 ViewManagerSynchronizer::ViewManagerSynchronizer(ViewManager* view_manager) 336 ViewManagerSynchronizer::ViewManagerSynchronizer(ViewManager* view_manager)
337 : view_manager_(view_manager), 337 : view_manager_(view_manager),
338 connected_(false), 338 connected_(false),
339 connection_id_(0), 339 connection_id_(0),
340 next_id_(1), 340 next_id_(1),
341 next_server_change_id_(0), 341 next_server_change_id_(0),
342 sync_factory_(this), 342 sync_factory_(this),
343 init_loop_(NULL) { 343 init_loop_(NULL) {
344 ConnectTo(ViewManagerPrivate(view_manager_).shell(), "mojo:mojo_view_manager", 344 ConnectTo(ViewManagerPrivate(view_manager_).shell(), "mojo:mojo_view_manager",
345 &service_); 345 &service_);
346 service_->SetClient(this); 346 service_.set_client(this);
347 347
348 // Start a runloop. This loop is quit when the server tells us about the 348 // Start a runloop. This loop is quit when the server tells us about the
349 // connection (OnConnectionEstablished()). 349 // connection (OnConnectionEstablished()).
350 base::RunLoop loop; 350 base::RunLoop loop;
351 init_loop_ = &loop; 351 init_loop_ = &loop;
352 init_loop_->Run(); 352 init_loop_->Run();
353 init_loop_ = NULL; 353 init_loop_ = NULL;
354 } 354 }
355 355
356 ViewManagerSynchronizer::~ViewManagerSynchronizer() { 356 ViewManagerSynchronizer::~ViewManagerSynchronizer() {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 void ViewManagerSynchronizer::RemoveFromPendingQueue( 539 void ViewManagerSynchronizer::RemoveFromPendingQueue(
540 ViewManagerTransaction* transaction) { 540 ViewManagerTransaction* transaction) {
541 DCHECK_EQ(transaction, pending_transactions_.front()); 541 DCHECK_EQ(transaction, pending_transactions_.front());
542 pending_transactions_.erase(pending_transactions_.begin()); 542 pending_transactions_.erase(pending_transactions_.begin());
543 if (pending_transactions_.empty() && !changes_acked_callback_.is_null()) 543 if (pending_transactions_.empty() && !changes_acked_callback_.is_null())
544 changes_acked_callback_.Run(); 544 changes_acked_callback_.Run();
545 } 545 }
546 546
547 } // namespace view_manager 547 } // namespace view_manager
548 } // namespace mojo 548 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/service_manager/service_manager_unittest.cc ('k') | mojo/services/view_manager/view_manager_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698