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

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

Issue 1530443005: EDK: Add PlatformHandleWatcher to Channel (and ChannelManager) classes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « mojo/edk/system/data_pipe_impl_unittest.cc ('k') | mojo/edk/system/message_pipe_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ipc_support.h" 5 #include "mojo/edk/system/ipc_support.h"
6 6
7 #include <type_traits> 7 #include <type_traits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 connection_manager_.reset( 60 connection_manager_.reset(
61 new system::SlaveConnectionManager(platform_support)); 61 new system::SlaveConnectionManager(platform_support));
62 static_cast<system::SlaveConnectionManager*>(connection_manager_.get()) 62 static_cast<system::SlaveConnectionManager*>(connection_manager_.get())
63 ->Init( 63 ->Init(
64 delegate_thread_task_runner_.Clone(), 64 delegate_thread_task_runner_.Clone(),
65 static_cast<embedder::SlaveProcessDelegate*>(process_delegate_), 65 static_cast<embedder::SlaveProcessDelegate*>(process_delegate_),
66 platform_handle.Pass()); 66 platform_handle.Pass());
67 break; 67 break;
68 } 68 }
69 69
70 channel_manager_.reset(new ChannelManager( 70 channel_manager_.reset(
71 platform_support, io_task_runner_.Clone(), connection_manager_.get())); 71 new ChannelManager(platform_support, io_task_runner_.Clone(), io_watcher_,
72 connection_manager_.get()));
72 } 73 }
73 74
74 IPCSupport::~IPCSupport() { 75 IPCSupport::~IPCSupport() {
75 DCHECK_EQ(process_type_, embedder::ProcessType::UNINITIALIZED); 76 DCHECK_EQ(process_type_, embedder::ProcessType::UNINITIALIZED);
76 } 77 }
77 78
78 void IPCSupport::ShutdownOnIOThread() { 79 void IPCSupport::ShutdownOnIOThread() {
79 DCHECK_NE(process_type_, embedder::ProcessType::UNINITIALIZED); 80 DCHECK_NE(process_type_, embedder::ProcessType::UNINITIALIZED);
80 81
81 channel_manager_->ShutdownOnIOThread(); 82 channel_manager_->ShutdownOnIOThread();
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 CHECK_EQ(connection_manager()->Connect(connection_id, &peer_id, &is_first, 169 CHECK_EQ(connection_manager()->Connect(connection_id, &peer_id, &is_first,
169 &platform_connection_handle), 170 &platform_connection_handle),
170 ConnectionManager::Result::SUCCESS_CONNECT_NEW_CONNECTION); 171 ConnectionManager::Result::SUCCESS_CONNECT_NEW_CONNECTION);
171 DCHECK_EQ(peer_id, system::kMasterProcessIdentifier); 172 DCHECK_EQ(peer_id, system::kMasterProcessIdentifier);
172 DCHECK(platform_connection_handle.is_valid()); 173 DCHECK(platform_connection_handle.is_valid());
173 return platform_connection_handle; 174 return platform_connection_handle;
174 } 175 }
175 176
176 } // namespace system 177 } // namespace system
177 } // namespace mojo 178 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/data_pipe_impl_unittest.cc ('k') | mojo/edk/system/message_pipe_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698