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

Unified Diff: mojo/edk/system/raw_channel.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/raw_channel.h ('k') | mojo/edk/system/raw_channel_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/raw_channel.cc
diff --git a/mojo/edk/system/raw_channel.cc b/mojo/edk/system/raw_channel.cc
index 16f924d7a9761e8285037e3091549cf8d59ba580..3b83a67bb030d4232db7f87824341f1b6de58c4e 100644
--- a/mojo/edk/system/raw_channel.cc
+++ b/mojo/edk/system/raw_channel.cc
@@ -16,6 +16,7 @@
#include "mojo/edk/system/message_in_transit.h"
#include "mojo/edk/system/transport_data.h"
+using mojo::embedder::ScopedPlatformHandle;
using mojo::util::MutexLocker;
namespace mojo {
@@ -58,7 +59,7 @@ bool RawChannel::WriteBuffer::HavePlatformHandlesToSend() const {
if (!transport_data)
return false;
- const embedder::PlatformHandleVector* all_platform_handles =
+ const std::vector<ScopedPlatformHandle>* all_platform_handles =
transport_data->platform_handles();
if (!all_platform_handles) {
DCHECK_EQ(platform_handles_offset_, 0u);
@@ -80,11 +81,12 @@ void RawChannel::WriteBuffer::GetPlatformHandlesToSend(
MessageInTransit* message = message_queue_.PeekMessage();
TransportData* transport_data = message->transport_data();
- embedder::PlatformHandleVector* all_platform_handles =
+ std::vector<ScopedPlatformHandle>* all_platform_handles =
transport_data->platform_handles();
*num_platform_handles =
all_platform_handles->size() - platform_handles_offset_;
- *platform_handles = &(*all_platform_handles)[platform_handles_offset_];
+ *platform_handles = reinterpret_cast<embedder::PlatformHandle*>(
+ &(*all_platform_handles)[platform_handles_offset_]);
if (serialized_platform_handle_size_ > 0) {
size_t serialization_data_offset =
@@ -326,7 +328,7 @@ void RawChannel::OnReadCompleted(IOResult io_result, size_t bytes_read) {
return; // |this| may have been destroyed in |CallOnError()|.
}
} else {
- embedder::ScopedPlatformHandleVectorPtr platform_handles;
+ std::unique_ptr<std::vector<ScopedPlatformHandle>> platform_handles;
if (message_view.transport_data_buffer()) {
size_t num_platform_handles;
const void* platform_handle_table;
« no previous file with comments | « mojo/edk/system/raw_channel.h ('k') | mojo/edk/system/raw_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698