OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ipc/ipc_message.h" | 5 #include "ipc/ipc_message.h" |
6 | 6 |
7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 : Pickle(sizeof(Header)) { | 43 : Pickle(sizeof(Header)) { |
44 header()->routing = header()->type = 0; | 44 header()->routing = header()->type = 0; |
45 header()->flags = GetRefNumUpper24(); | 45 header()->flags = GetRefNumUpper24(); |
46 #if defined(OS_POSIX) | 46 #if defined(OS_POSIX) |
47 header()->num_fds = 0; | 47 header()->num_fds = 0; |
48 header()->pad = 0; | 48 header()->pad = 0; |
49 #endif | 49 #endif |
50 InitLoggingVariables(); | 50 InitLoggingVariables(); |
51 } | 51 } |
52 | 52 |
53 Message::Message(int32 routing_id, uint32 type) | 53 Message::Message(int32 routing_id, uint32 type, PriorityValue priority) |
54 : Pickle(sizeof(Header)) { | 54 : Pickle(sizeof(Header)) { |
55 header()->routing = routing_id; | 55 header()->routing = routing_id; |
56 header()->type = type; | 56 header()->type = type; |
57 header()->flags = GetRefNumUpper24(); | 57 DCHECK((priority & 0xffffff00) == 0); |
| 58 header()->flags = priority | GetRefNumUpper24(); |
58 #if defined(OS_POSIX) | 59 #if defined(OS_POSIX) |
59 header()->num_fds = 0; | 60 header()->num_fds = 0; |
60 header()->pad = 0; | 61 header()->pad = 0; |
61 #endif | 62 #endif |
62 InitLoggingVariables(); | 63 InitLoggingVariables(); |
63 } | 64 } |
64 | 65 |
65 Message::Message(const char* data, size_t data_len) | 66 Message::Message(const char* data, int data_len) : Pickle(data, data_len) { |
66 : Pickle(data, data_len) { | |
67 InitLoggingVariables(); | 67 InitLoggingVariables(); |
68 } | 68 } |
69 | 69 |
70 Message::Message(const Message& other) : Pickle(other) { | 70 Message::Message(const Message& other) : Pickle(other) { |
71 InitLoggingVariables(); | 71 InitLoggingVariables(); |
72 #if defined(OS_POSIX) | 72 #if defined(OS_POSIX) |
73 file_descriptor_set_ = other.file_descriptor_set_; | 73 file_descriptor_set_ = other.file_descriptor_set_; |
74 #endif | 74 #endif |
75 } | 75 } |
76 | 76 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 void Message::EnsureFileDescriptorSet() { | 155 void Message::EnsureFileDescriptorSet() { |
156 if (file_descriptor_set_.get() == NULL) | 156 if (file_descriptor_set_.get() == NULL) |
157 file_descriptor_set_ = new FileDescriptorSet; | 157 file_descriptor_set_ = new FileDescriptorSet; |
158 } | 158 } |
159 | 159 |
160 #endif | 160 #endif |
161 | 161 |
162 } // namespace IPC | 162 } // namespace IPC |
OLD | NEW |