| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/ipc_message.h" | 5 #include "chrome/common/ipc_message.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "build/build_config.h" |
| 8 | 9 |
| 9 namespace IPC { | 10 namespace IPC { |
| 10 | 11 |
| 11 //------------------------------------------------------------------------------ | 12 //------------------------------------------------------------------------------ |
| 12 | 13 |
| 13 Message::~Message() { | 14 Message::~Message() { |
| 14 } | 15 } |
| 15 | 16 |
| 16 Message::Message() | 17 Message::Message() |
| 17 : Pickle(sizeof(Header)) { | 18 : Pickle(sizeof(Header)) { |
| 18 header()->routing = header()->type = header()->flags = 0; | 19 header()->routing = header()->type = header()->flags = 0; |
| 20 #if defined(OS_POSIX) |
| 21 header()->num_fds = 0; |
| 22 #endif |
| 19 InitLoggingVariables(); | 23 InitLoggingVariables(); |
| 20 } | 24 } |
| 21 | 25 |
| 22 Message::Message(int32 routing_id, uint16 type, PriorityValue priority) | 26 Message::Message(int32 routing_id, uint16 type, PriorityValue priority) |
| 23 : Pickle(sizeof(Header)) { | 27 : Pickle(sizeof(Header)) { |
| 24 header()->routing = routing_id; | 28 header()->routing = routing_id; |
| 25 header()->type = type; | 29 header()->type = type; |
| 26 header()->flags = priority; | 30 header()->flags = priority; |
| 31 #if defined(OS_POSIX) |
| 32 header()->num_fds = 0; |
| 33 #endif |
| 27 InitLoggingVariables(); | 34 InitLoggingVariables(); |
| 28 } | 35 } |
| 29 | 36 |
| 30 Message::Message(const char* data, int data_len) : Pickle(data, data_len) { | 37 Message::Message(const char* data, int data_len) : Pickle(data, data_len) { |
| 31 InitLoggingVariables(); | 38 InitLoggingVariables(); |
| 32 } | 39 } |
| 33 | 40 |
| 34 Message::Message(const Message& other) : Pickle(other) { | 41 Message::Message(const Message& other) : Pickle(other) { |
| 35 InitLoggingVariables(); | 42 InitLoggingVariables(); |
| 36 } | 43 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 64 return *(reinterpret_cast<const int64*>(data)); | 71 return *(reinterpret_cast<const int64*>(data)); |
| 65 } | 72 } |
| 66 | 73 |
| 67 void Message::set_received_time(int64 time) const { | 74 void Message::set_received_time(int64 time) const { |
| 68 received_time_ = time; | 75 received_time_ = time; |
| 69 } | 76 } |
| 70 #endif | 77 #endif |
| 71 | 78 |
| 72 } // namespace IPC | 79 } // namespace IPC |
| 73 | 80 |
| OLD | NEW |