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

Unified Diff: mojo/edk/system/slave_connection_manager.cc

Issue 1478503003: EDK: Convert most uses of PlatformHandleVector to std::vector<ScopedPlatformHandle>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/slave_connection_manager.h ('k') | mojo/edk/system/transport_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/slave_connection_manager.cc
diff --git a/mojo/edk/system/slave_connection_manager.cc b/mojo/edk/system/slave_connection_manager.cc
index 0018a60b0167e9938ed8c303eff244c057e21e23..c0504e7eed3ae2a82d5bf69e0a46122a135a3a71 100644
--- a/mojo/edk/system/slave_connection_manager.cc
+++ b/mojo/edk/system/slave_connection_manager.cc
@@ -15,6 +15,7 @@
#include "mojo/edk/system/message_in_transit.h"
#include "mojo/edk/util/make_unique.h"
+using mojo::embedder::ScopedPlatformHandle;
using mojo::platform::TaskRunner;
using mojo::util::MutexLocker;
using mojo::util::RefPtr;
@@ -49,7 +50,7 @@ SlaveConnectionManager::~SlaveConnectionManager() {
void SlaveConnectionManager::Init(
RefPtr<TaskRunner>&& delegate_thread_task_runner,
embedder::SlaveProcessDelegate* slave_process_delegate,
- embedder::ScopedPlatformHandle platform_handle) {
+ ScopedPlatformHandle platform_handle) {
DCHECK(delegate_thread_task_runner);
DCHECK(slave_process_delegate);
DCHECK(platform_handle.is_valid());
@@ -116,7 +117,7 @@ ConnectionManager::Result SlaveConnectionManager::Connect(
const ConnectionIdentifier& connection_id,
ProcessIdentifier* peer_process_identifier,
bool* is_first,
- embedder::ScopedPlatformHandle* platform_handle) {
+ ScopedPlatformHandle* platform_handle) {
AssertNotOnPrivateThread();
DCHECK(peer_process_identifier);
DCHECK(is_first);
@@ -135,7 +136,7 @@ ConnectionManager::Result SlaveConnectionManager::Connect(
}
void SlaveConnectionManager::InitOnPrivateThread(
- embedder::ScopedPlatformHandle platform_handle) {
+ ScopedPlatformHandle platform_handle) {
AssertOnPrivateThread();
raw_channel_ = RawChannel::Create(platform_handle.Pass());
@@ -208,7 +209,7 @@ void SlaveConnectionManager::ConnectOnPrivateThread(
Result* result,
ProcessIdentifier* peer_process_identifier,
bool* is_first,
- embedder::ScopedPlatformHandle* platform_handle) {
+ ScopedPlatformHandle* platform_handle) {
DCHECK(result);
AssertOnPrivateThread();
// This should only posted (from another thread, to |private_thread_|) with
@@ -236,7 +237,7 @@ void SlaveConnectionManager::ConnectOnPrivateThread(
void SlaveConnectionManager::OnReadMessage(
const MessageInTransit::View& message_view,
- embedder::ScopedPlatformHandleVectorPtr platform_handles) {
+ std::unique_ptr<std::vector<ScopedPlatformHandle>> platform_handles) {
AssertOnPrivateThread();
// Set |*ack_result_| to failure by default.
@@ -292,8 +293,7 @@ void SlaveConnectionManager::OnReadMessage(
CONNECTION_MANAGER_ACK_SUCCESS_CONNECT_NEW_CONNECTION:
CHECK_EQ(num_platform_handles, 1u);
*ack_result_ = Result::SUCCESS_CONNECT_NEW_CONNECTION;
- ack_platform_handle_->reset(platform_handles->at(0));
- platform_handles->at(0) = embedder::PlatformHandle();
+ *ack_platform_handle_ = std::move(platform_handles->at(0));
break;
case MessageInTransit::Subtype::
CONNECTION_MANAGER_ACK_SUCCESS_CONNECT_REUSE_CONNECTION:
« no previous file with comments | « mojo/edk/system/slave_connection_manager.h ('k') | mojo/edk/system/transport_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698