| Index: mojo/edk/system/transport_data.cc
|
| diff --git a/third_party/mojo/src/mojo/edk/system/transport_data.cc b/mojo/edk/system/transport_data.cc
|
| similarity index 96%
|
| copy from third_party/mojo/src/mojo/edk/system/transport_data.cc
|
| copy to mojo/edk/system/transport_data.cc
|
| index 8d9b229b08a4d6b85ed052ea51a90d067dd755b3..d31bd5962349042ca55e95547d77d6b8856d336e 100644
|
| --- a/third_party/mojo/src/mojo/edk/system/transport_data.cc
|
| +++ b/mojo/edk/system/transport_data.cc
|
| @@ -4,12 +4,10 @@
|
|
|
| #include "mojo/edk/system/transport_data.h"
|
|
|
| -#include <string.h>
|
| -
|
| #include "base/logging.h"
|
| -#include "mojo/edk/system/channel.h"
|
| #include "mojo/edk/system/configuration.h"
|
| #include "mojo/edk/system/message_in_transit.h"
|
| +#include "mojo/edk/system/raw_channel.h"
|
|
|
| namespace mojo {
|
| namespace system {
|
| @@ -60,11 +58,9 @@ struct TransportData::PrivateStructForCompileAsserts {
|
| "alignment");
|
| };
|
|
|
| -TransportData::TransportData(scoped_ptr<DispatcherVector> dispatchers,
|
| - Channel* channel)
|
| +TransportData::TransportData(scoped_ptr<DispatcherVector> dispatchers)
|
| : buffer_size_() {
|
| DCHECK(dispatchers);
|
| - DCHECK(channel);
|
|
|
| const size_t num_handles = dispatchers->size();
|
| DCHECK_GT(num_handles, 0u);
|
| @@ -87,7 +83,7 @@ TransportData::TransportData(scoped_ptr<DispatcherVector> dispatchers,
|
| size_t max_size = 0;
|
| size_t max_platform_handles = 0;
|
| Dispatcher::TransportDataAccess::StartSerialize(
|
| - dispatcher, channel, &max_size, &max_platform_handles);
|
| + dispatcher, &max_size, &max_platform_handles);
|
|
|
| DCHECK_LE(max_size, kMaxSerializedDispatcherSize);
|
| estimated_size += MessageInTransit::RoundUpMessageAlignment(max_size);
|
| @@ -106,7 +102,7 @@ TransportData::TransportData(scoped_ptr<DispatcherVector> dispatchers,
|
|
|
| size_t size_per_platform_handle = 0;
|
| if (estimated_num_platform_handles > 0) {
|
| - size_per_platform_handle = channel->GetSerializedPlatformHandleSize();
|
| + size_per_platform_handle = RawChannel::GetSerializedPlatformHandleSize();
|
| DCHECK_LE(size_per_platform_handle, kMaxSizePerPlatformHandle);
|
| estimated_size += estimated_num_platform_handles * size_per_platform_handle;
|
| estimated_size = MessageInTransit::RoundUpMessageAlignment(estimated_size);
|
| @@ -149,7 +145,7 @@ TransportData::TransportData(scoped_ptr<DispatcherVector> dispatchers,
|
| void* destination = buffer_.get() + current_offset;
|
| size_t actual_size = 0;
|
| if (Dispatcher::TransportDataAccess::EndSerializeAndClose(
|
| - dispatcher, channel, destination, &actual_size,
|
| + dispatcher, destination, &actual_size,
|
| platform_handles_.get())) {
|
| handle_table[i].type = static_cast<int32_t>(dispatcher->GetType());
|
| handle_table[i].offset = static_cast<uint32_t>(current_offset);
|
| @@ -309,11 +305,10 @@ void TransportData::GetPlatformHandleTable(const void* transport_data_buffer,
|
| scoped_ptr<DispatcherVector> TransportData::DeserializeDispatchers(
|
| const void* buffer,
|
| size_t buffer_size,
|
| - embedder::ScopedPlatformHandleVectorPtr platform_handles,
|
| - Channel* channel) {
|
| + embedder::ScopedPlatformHandleVectorPtr platform_handles) {
|
| DCHECK(buffer);
|
| DCHECK_GT(buffer_size, 0u);
|
| - DCHECK(channel);
|
| + //DCHECK(channel);
|
|
|
| const Header* header = static_cast<const Header*>(buffer);
|
| const size_t num_handles = header->num_handles;
|
| @@ -332,7 +327,7 @@ scoped_ptr<DispatcherVector> TransportData::DeserializeDispatchers(
|
|
|
| const void* source = static_cast<const char*>(buffer) + offset;
|
| (*dispatchers)[i] = Dispatcher::TransportDataAccess::Deserialize(
|
| - channel, handle_table[i].type, source, size, platform_handles.get());
|
| + handle_table[i].type, source, size, platform_handles.get());
|
| }
|
|
|
| return dispatchers.Pass();
|
|
|