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

Side by Side Diff: ipc/ipc_send_fds_test.cc

Issue 1154283003: Change most uses of Pickle to base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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_perftest_support.cc ('k') | ipc/ipc_sync_message.cc » ('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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_POSIX) 7 #if defined(OS_POSIX)
8 #if defined(OS_MACOSX) 8 #if defined(OS_MACOSX)
9 extern "C" { 9 extern "C" {
10 #include <sandbox.h> 10 #include <sandbox.h>
(...skipping 29 matching lines...) Expand all
40 40
41 #if defined(OS_POSIX) 41 #if defined(OS_POSIX)
42 static_assert(kNumFDsToSend == 42 static_assert(kNumFDsToSend ==
43 IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage, 43 IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage,
44 "The number of FDs to send must be kMaxDescriptorsPerMessage."); 44 "The number of FDs to send must be kMaxDescriptorsPerMessage.");
45 #endif 45 #endif
46 46
47 class MyChannelDescriptorListenerBase : public IPC::Listener { 47 class MyChannelDescriptorListenerBase : public IPC::Listener {
48 public: 48 public:
49 bool OnMessageReceived(const IPC::Message& message) override { 49 bool OnMessageReceived(const IPC::Message& message) override {
50 PickleIterator iter(message); 50 base::PickleIterator iter(message);
51 base::FileDescriptor descriptor; 51 base::FileDescriptor descriptor;
52 while (IPC::ParamTraits<base::FileDescriptor>::Read( 52 while (IPC::ParamTraits<base::FileDescriptor>::Read(
53 &message, &iter, &descriptor)) { 53 &message, &iter, &descriptor)) {
54 HandleFD(descriptor.fd); 54 HandleFD(descriptor.fd);
55 } 55 }
56 return true; 56 return true;
57 } 57 }
58 58
59 protected: 59 protected:
60 virtual void HandleFD(int fd) = 0; 60 virtual void HandleFD(int fd) = 0;
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 base::WaitableEvent received_; 373 base::WaitableEvent received_;
374 }; 374 };
375 375
376 TEST_F(IPCMultiSendingFdsTest, StressTest) { 376 TEST_F(IPCMultiSendingFdsTest, StressTest) {
377 Run(); 377 Run();
378 } 378 }
379 379
380 } // namespace 380 } // namespace
381 381
382 #endif // defined(OS_POSIX) 382 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « ipc/ipc_perftest_support.cc ('k') | ipc/ipc_sync_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698