Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Side by Side Diff: ipc/ipc_channel.cc

Issue 1309003003: ipc: Add the inner class OutputElement to Channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_add_header3
Patch Set: Fix typo. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698