From c0d5d87785cabb1135e583dd78a41354feff4c01 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Tue, 2 Dec 2014 17:02:32 -0500 Subject: [PATCH] Move mach_message_util.* to mach_message.*. A subsequent change will add MachMessageWithDeadline(), a mach_msg() wrapper. Conceptually, it makes sense to include that function in this file family. Since this file family now contains a mach_msg() wrapper, it makes sense to rename it mach_message and lose the _util suffix. R=rsesek@chromium.org Review URL: https://codereview.chromium.org/772133004 --- util/mach/child_port_server.cc | 2 +- util/mach/exc_server_variants.cc | 2 +- util/mach/exc_server_variants_test.cc | 2 +- util/mach/{mach_message_util.cc => mach_message.cc} | 2 +- util/mach/{mach_message_util.h => mach_message.h} | 6 +++--- .../{mach_message_util_test.cc => mach_message_test.cc} | 9 ++++----- util/util.gyp | 6 +++--- 7 files changed, 14 insertions(+), 15 deletions(-) rename util/mach/{mach_message_util.cc => mach_message.cc} (97%) rename util/mach/{mach_message_util.h => mach_message.h} (95%) rename util/mach/{mach_message_util_test.cc => mach_message_test.cc} (91%) diff --git a/util/mach/child_port_server.cc b/util/mach/child_port_server.cc index 2118d037..5f4b3224 100644 --- a/util/mach/child_port_server.cc +++ b/util/mach/child_port_server.cc @@ -16,7 +16,7 @@ #include "base/logging.h" #include "util/mach/child_portServer.h" -#include "util/mach/mach_message_util.h" +#include "util/mach/mach_message.h" extern "C" { diff --git a/util/mach/exc_server_variants.cc b/util/mach/exc_server_variants.cc index 34d7f960..8dccddee 100644 --- a/util/mach/exc_server_variants.cc +++ b/util/mach/exc_server_variants.cc @@ -23,7 +23,7 @@ #include "util/mach/excServer.h" #include "util/mach/mach_exc.h" #include "util/mach/mach_excServer.h" -#include "util/mach/mach_message_util.h" +#include "util/mach/mach_message.h" extern "C" { diff --git a/util/mach/exc_server_variants_test.cc b/util/mach/exc_server_variants_test.cc index 8cf34d46..221013f7 100644 --- a/util/mach/exc_server_variants_test.cc +++ b/util/mach/exc_server_variants_test.cc @@ -23,7 +23,7 @@ #include "gtest/gtest.h" #include "util/mach/exception_behaviors.h" #include "util/mach/mach_extensions.h" -#include "util/mach/mach_message_util.h" +#include "util/mach/mach_message.h" #include "util/test/mac/mach_errors.h" #include "util/test/mac/mach_multiprocess.h" diff --git a/util/mach/mach_message_util.cc b/util/mach/mach_message.cc similarity index 97% rename from util/mach/mach_message_util.cc rename to util/mach/mach_message.cc index a6e61d1e..498dbb74 100644 --- a/util/mach/mach_message_util.cc +++ b/util/mach/mach_message.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "util/mach/mach_message_util.h" +#include "util/mach/mach_message.h" namespace crashpad { diff --git a/util/mach/mach_message_util.h b/util/mach/mach_message.h similarity index 95% rename from util/mach/mach_message_util.h rename to util/mach/mach_message.h index dd5bc014..3b013770 100644 --- a/util/mach/mach_message_util.h +++ b/util/mach/mach_message.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef CRASHPAD_UTIL_MACH_MACH_MESSAGE_UTIL_H_ -#define CRASHPAD_UTIL_MACH_MACH_MESSAGE_UTIL_H_ +#ifndef CRASHPAD_UTIL_MACH_MACH_MESSAGE_H_ +#define CRASHPAD_UTIL_MACH_MACH_MESSAGE_H_ #include @@ -64,4 +64,4 @@ const mach_msg_trailer_t* MachMessageTrailerFromHeader( } // namespace crashpad -#endif // CRASHPAD_UTIL_MACH_MACH_MESSAGE_UTIL_H_ +#endif // CRASHPAD_UTIL_MACH_MACH_MESSAGE_H_ diff --git a/util/mach/mach_message_util_test.cc b/util/mach/mach_message_test.cc similarity index 91% rename from util/mach/mach_message_util_test.cc rename to util/mach/mach_message_test.cc index 66543067..b807b7ed 100644 --- a/util/mach/mach_message_util_test.cc +++ b/util/mach/mach_message_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "util/mach/mach_message_util.h" +#include "util/mach/mach_message.h" #include "base/basictypes.h" #include "gtest/gtest.h" @@ -22,7 +22,7 @@ namespace crashpad { namespace test { namespace { -TEST(MachMessageUtil, PrepareMIGReplyFromRequest_SetMIGReplyError) { +TEST(MachMessage, PrepareMIGReplyFromRequest_SetMIGReplyError) { mach_msg_header_t request; request.msgh_bits = MACH_MSGH_BITS_COMPLEX | @@ -63,7 +63,7 @@ TEST(MachMessageUtil, PrepareMIGReplyFromRequest_SetMIGReplyError) { EXPECT_EQ(MIG_BAD_ID, reply.RetCode); } -TEST(MachMessageUtil, MachMessageTrailerFromHeader) { +TEST(MachMessage, MachMessageTrailerFromHeader) { mach_msg_empty_t empty; empty.send.header.msgh_size = sizeof(mach_msg_empty_send_t); EXPECT_EQ(&empty.rcv.trailer, @@ -82,8 +82,7 @@ TEST(MachMessageUtil, MachMessageTrailerFromHeader) { TestMessage test; test.send.msgh_size = sizeof(TestSendMessage); - EXPECT_EQ(&test.receive.trailer, - MachMessageTrailerFromHeader(&test.receive)); + EXPECT_EQ(&test.receive.trailer, MachMessageTrailerFromHeader(&test.receive)); } } // namespace diff --git a/util/util.gyp b/util/util.gyp index 4a20b837..70c0245a 100644 --- a/util/util.gyp +++ b/util/util.gyp @@ -55,10 +55,10 @@ 'mach/exception_ports.h', 'mach/mach_extensions.cc', 'mach/mach_extensions.h', + 'mach/mach_message.cc', + 'mach/mach_message.h', 'mach/mach_message_server.cc', 'mach/mach_message_server.h', - 'mach/mach_message_util.cc', - 'mach/mach_message_util.h', 'mach/scoped_task_suspend.cc', 'mach/scoped_task_suspend.h', 'mach/symbolic_constants_mach.cc', @@ -246,7 +246,7 @@ 'mach/exception_ports_test.cc', 'mach/mach_extensions_test.cc', 'mach/mach_message_server_test.cc', - 'mach/mach_message_util_test.cc', + 'mach/mach_message_test.cc', 'mach/scoped_task_suspend_test.cc', 'mach/symbolic_constants_mach_test.cc', 'mach/task_memory_test.cc',