| 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_channel.h" | 5 #include "ipc/ipc_channel.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 int process_id = -1; | 36 int process_id = -1; |
| 37 #else | 37 #else |
| 38 int process_id = base::GetCurrentProcId(); | 38 int process_id = base::GetCurrentProcId(); |
| 39 #endif | 39 #endif |
| 40 return base::StringPrintf("%d.%u.%d", | 40 return base::StringPrintf("%d.%u.%d", |
| 41 process_id, | 41 process_id, |
| 42 g_last_id.GetNext(), | 42 g_last_id.GetNext(), |
| 43 base::RandInt(0, std::numeric_limits<int32_t>::max())); | 43 base::RandInt(0, std::numeric_limits<int32_t>::max())); |
| 44 } | 44 } |
| 45 | 45 |
| 46 Channel::OutputElement::OutputElement(Message* message) |
| 47 : message_(message), buffer_(nullptr), length_(0) {} |
| 48 |
| 49 Channel::OutputElement::OutputElement(void* buffer, size_t length) |
| 50 : message_(nullptr), buffer_(buffer), length_(length) {} |
| 51 |
| 52 Channel::OutputElement::~OutputElement() { |
| 53 free(buffer_); |
| 54 } |
| 55 |
| 46 } // namespace IPC | 56 } // namespace IPC |
| OLD | NEW |