diff options
author | erikchen <erikchen@chromium.org> | 2015-10-09 18:10:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-10 01:11:03 +0000 |
commit | 87397e0140327124f38096d1fc88190a6154a9fd (patch) | |
tree | 3e875bcf138057d28b7478cf91ee28cc93115c3f | |
parent | ebf7da11adedc435768f9e3964dd91bf422a5e6f (diff) | |
download | chromium_src-87397e0140327124f38096d1fc88190a6154a9fd.zip chromium_src-87397e0140327124f38096d1fc88190a6154a9fd.tar.gz chromium_src-87397e0140327124f38096d1fc88190a6154a9fd.tar.bz2 |
ipc: Add missing includes for USE_ATTACHMENT_BROKER.
The preprocessor variable is defined in ipc/attachment_broker.h. There were
three files that were using the variable without including the header.
BUG=535711
Review URL: https://codereview.chromium.org/1392713004
Cr-Commit-Position: refs/heads/master@{#353448}
-rw-r--r-- | content/common/child_process_host_impl.cc | 1 | ||||
-rw-r--r-- | ipc/ipc_message.cc | 5 | ||||
-rw-r--r-- | ipc/ipc_message_unittest.cc | 7 |
3 files changed, 8 insertions, 5 deletions
diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc index cc0fc54..71b5d6e 100644 --- a/content/common/child_process_host_impl.cc +++ b/content/common/child_process_host_impl.cc @@ -25,6 +25,7 @@ #include "content/public/common/child_process_host_delegate.h" #include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" +#include "ipc/attachment_broker.h" #include "ipc/ipc_channel.h" #include "ipc/ipc_logging.h" #include "ipc/message_filter.h" diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc index 684c11b..4980b40 100644 --- a/ipc/ipc_message.cc +++ b/ipc/ipc_message.cc @@ -9,6 +9,7 @@ #include "base/atomic_sequence_num.h" #include "base/logging.h" #include "build/build_config.h" +#include "ipc/attachment_broker.h" #include "ipc/ipc_message_attachment.h" #include "ipc/ipc_message_attachment_set.h" #include "ipc/placeholder_brokerable_attachment.h" @@ -178,7 +179,7 @@ void Message::FindNext(const char* range_start, bool have_entire_pickle = static_cast<size_t>(range_end - range_start) >= pickle_size; -#if USE_ATTACHMENT_BROKER +#if USE_ATTACHMENT_BROKER && defined(OS_MACOSX) && !defined(OS_IOS) // TODO(dskiba): determine message_size when entire pickle is not available if (!have_entire_pickle) @@ -204,7 +205,7 @@ void Message::FindNext(const char* range_start, if (buffer_length < attachment_length + pickle_size) return; - for (int i = 0; i < num_attachments; ++i) { + for (size_t i = 0; i < num_attachments; ++i) { const char* attachment_start = pickle_end + i * BrokerableAttachment::kNonceSize; BrokerableAttachment::AttachmentId id(attachment_start, diff --git a/ipc/ipc_message_unittest.cc b/ipc/ipc_message_unittest.cc index a4f9af0..bb133e5 100644 --- a/ipc/ipc_message_unittest.cc +++ b/ipc/ipc_message_unittest.cc @@ -11,6 +11,7 @@ #include "base/memory/scoped_ptr.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "ipc/attachment_broker.h" #include "ipc/ipc_message_utils.h" #include "testing/gtest/include/gtest/gtest.h" @@ -148,7 +149,7 @@ TEST(IPCMessageTest, FindNext) { // (but contains the message header) IPC::Message::FindNext(data_start, data_end - 1, &next); EXPECT_FALSE(next.message_found); -#if USE_ATTACHMENT_BROKER +#if USE_ATTACHMENT_BROKER && defined(OS_MACOSX) && !defined(OS_IOS) EXPECT_EQ(next.message_size, 0u); #else EXPECT_EQ(next.message_size, message.size()); @@ -184,7 +185,7 @@ TEST(IPCMessageTest, FindNextOverflow) { message.header()->payload_size = static_cast<uint32_t>(-1); IPC::Message::FindNext(data_start, data_end, &next); EXPECT_FALSE(next.message_found); -#if USE_ATTACHMENT_BROKER +#if USE_ATTACHMENT_BROKER && defined(OS_MACOSX) && !defined(OS_IOS) EXPECT_EQ(next.message_size, 0u); #else if (sizeof(size_t) > sizeof(uint32_t)) { @@ -202,7 +203,7 @@ TEST(IPCMessageTest, FindNextOverflow) { message.header()->payload_size = std::numeric_limits<int32_t>::max(); IPC::Message::FindNext(data_start, data_end, &next); EXPECT_FALSE(next.message_found); -#if USE_ATTACHMENT_BROKER +#if USE_ATTACHMENT_BROKER && defined(OS_MACOSX) && !defined(OS_IOS) EXPECT_EQ(next.message_size, 0u); #else EXPECT_EQ(next.message_size, |