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

Side by Side Diff: mojo/edk/system/slave_connection_manager.cc

Issue 1462083003: Add //mojo/edk/platform and move platform_task_runners.h there. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: update readme Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/edk/system/slave_connection_manager.h" 5 #include "mojo/edk/system/slave_connection_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "mojo/edk/system/connection_manager_messages.h" 14 #include "mojo/edk/system/connection_manager_messages.h"
15 #include "mojo/edk/system/message_in_transit.h" 15 #include "mojo/edk/system/message_in_transit.h"
16 #include "mojo/edk/util/make_unique.h" 16 #include "mojo/edk/util/make_unique.h"
17 17
18 using mojo::platform::TaskRunner;
18 using mojo::util::MutexLocker; 19 using mojo::util::MutexLocker;
19 using mojo::util::RefPtr; 20 using mojo::util::RefPtr;
20 21
21 namespace mojo { 22 namespace mojo {
22 namespace system { 23 namespace system {
23 24
24 // SlaveConnectionManager ------------------------------------------------------ 25 // SlaveConnectionManager ------------------------------------------------------
25 26
26 SlaveConnectionManager::SlaveConnectionManager( 27 SlaveConnectionManager::SlaveConnectionManager(
27 embedder::PlatformSupport* platform_support) 28 embedder::PlatformSupport* platform_support)
(...skipping 11 matching lines...) Expand all
39 DCHECK(!slave_process_delegate_); 40 DCHECK(!slave_process_delegate_);
40 DCHECK(!private_thread_.message_loop()); 41 DCHECK(!private_thread_.message_loop());
41 DCHECK_EQ(awaiting_ack_type_, NOT_AWAITING_ACK); 42 DCHECK_EQ(awaiting_ack_type_, NOT_AWAITING_ACK);
42 DCHECK(!ack_result_); 43 DCHECK(!ack_result_);
43 DCHECK(!ack_peer_process_identifier_); 44 DCHECK(!ack_peer_process_identifier_);
44 DCHECK(!ack_is_first_); 45 DCHECK(!ack_is_first_);
45 DCHECK(!ack_platform_handle_); 46 DCHECK(!ack_platform_handle_);
46 } 47 }
47 48
48 void SlaveConnectionManager::Init( 49 void SlaveConnectionManager::Init(
49 RefPtr<embedder::PlatformTaskRunner>&& delegate_thread_task_runner, 50 RefPtr<TaskRunner>&& delegate_thread_task_runner,
50 embedder::SlaveProcessDelegate* slave_process_delegate, 51 embedder::SlaveProcessDelegate* slave_process_delegate,
51 embedder::ScopedPlatformHandle platform_handle) { 52 embedder::ScopedPlatformHandle platform_handle) {
52 DCHECK(delegate_thread_task_runner); 53 DCHECK(delegate_thread_task_runner);
53 DCHECK(slave_process_delegate); 54 DCHECK(slave_process_delegate);
54 DCHECK(platform_handle.is_valid()); 55 DCHECK(platform_handle.is_valid());
55 DCHECK(!delegate_thread_task_runner_); 56 DCHECK(!delegate_thread_task_runner_);
56 DCHECK(!slave_process_delegate_); 57 DCHECK(!slave_process_delegate_);
57 DCHECK(!private_thread_.message_loop()); 58 DCHECK(!private_thread_.message_loop());
58 59
59 delegate_thread_task_runner_ = std::move(delegate_thread_task_runner); 60 delegate_thread_task_runner_ = std::move(delegate_thread_task_runner);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 340 }
340 341
341 void SlaveConnectionManager::AssertOnPrivateThread() const { 342 void SlaveConnectionManager::AssertOnPrivateThread() const {
342 // This should only be called after |Init()| and before |Shutdown()|. 343 // This should only be called after |Init()| and before |Shutdown()|.
343 DCHECK(private_thread_.message_loop()); 344 DCHECK(private_thread_.message_loop());
344 DCHECK_EQ(base::MessageLoop::current(), private_thread_.message_loop()); 345 DCHECK_EQ(base::MessageLoop::current(), private_thread_.message_loop());
345 } 346 }
346 347
347 } // namespace system 348 } // namespace system
348 } // namespace mojo 349 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698