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

Side by Side Diff: ipc/ipc_tests.cc

Issue 9429039: Cleanup: Remove base::environment_vector and base::file_handle_mapping_vector to StudlyCaps. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « content/public/browser/utility_process_host.h ('k') | net/test/test_server_posix.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_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #elif defined(OS_POSIX) 9 #elif defined(OS_POSIX)
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return NULL; 77 return NULL;
78 } 78 }
79 } 79 }
80 #elif defined(OS_POSIX) 80 #elif defined(OS_POSIX)
81 base::ProcessHandle IPCChannelTest::SpawnChild(ChildType child_type, 81 base::ProcessHandle IPCChannelTest::SpawnChild(ChildType child_type,
82 IPC::Channel *channel) { 82 IPC::Channel *channel) {
83 // kDebugChildren support. 83 // kDebugChildren support.
84 bool debug_on_start = 84 bool debug_on_start =
85 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDebugChildren); 85 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDebugChildren);
86 86
87 base::file_handle_mapping_vector fds_to_map; 87 base::FileHandleMappingVector fds_to_map;
88 const int ipcfd = channel->GetClientFileDescriptor(); 88 const int ipcfd = channel->GetClientFileDescriptor();
89 if (ipcfd > -1) { 89 if (ipcfd > -1) {
90 fds_to_map.push_back(std::pair<int, int>(ipcfd, kPrimaryIPCChannel + 3)); 90 fds_to_map.push_back(std::pair<int, int>(ipcfd, kPrimaryIPCChannel + 3));
91 } 91 }
92 92
93 base::ProcessHandle ret = base::kNullProcessHandle; 93 base::ProcessHandle ret = base::kNullProcessHandle;
94 switch (child_type) { 94 switch (child_type) {
95 case TEST_CLIENT: 95 case TEST_CLIENT:
96 ret = MultiProcessTest::SpawnChild("RunTestClient", 96 ret = MultiProcessTest::SpawnChild("RunTestClient",
97 fds_to_map, 97 fds_to_map,
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 IPC::ChannelProxy chan(kTestClientChannel, IPC::Channel::MODE_SERVER, 294 IPC::ChannelProxy chan(kTestClientChannel, IPC::Channel::MODE_SERVER,
295 &channel_listener, thread.message_loop_proxy()); 295 &channel_listener, thread.message_loop_proxy());
296 296
297 channel_listener.Init(&chan); 297 channel_listener.Init(&chan);
298 298
299 #if defined(OS_WIN) 299 #if defined(OS_WIN)
300 base::ProcessHandle process_handle = SpawnChild(TEST_CLIENT, NULL); 300 base::ProcessHandle process_handle = SpawnChild(TEST_CLIENT, NULL);
301 #elif defined(OS_POSIX) 301 #elif defined(OS_POSIX)
302 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( 302 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch(
303 switches::kDebugChildren); 303 switches::kDebugChildren);
304 base::file_handle_mapping_vector fds_to_map; 304 base::FileHandleMappingVector fds_to_map;
305 const int ipcfd = chan.GetClientFileDescriptor(); 305 const int ipcfd = chan.GetClientFileDescriptor();
306 if (ipcfd > -1) { 306 if (ipcfd > -1) {
307 fds_to_map.push_back(std::pair<int, int>(ipcfd, kPrimaryIPCChannel + 3)); 307 fds_to_map.push_back(std::pair<int, int>(ipcfd, kPrimaryIPCChannel + 3));
308 } 308 }
309 309
310 base::ProcessHandle process_handle = MultiProcessTest::SpawnChild( 310 base::ProcessHandle process_handle = MultiProcessTest::SpawnChild(
311 "RunTestClient", 311 "RunTestClient",
312 fds_to_map, 312 fds_to_map,
313 debug_on_start); 313 debug_on_start);
314 #endif // defined(OS_POSIX) 314 #endif // defined(OS_POSIX)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 IPC::Message* msg = new IPC::Message(0, 460 IPC::Message* msg = new IPC::Message(0,
461 2, 461 2,
462 IPC::Message::PRIORITY_NORMAL); 462 IPC::Message::PRIORITY_NORMAL);
463 msg->WriteInt(GetTickCount()); 463 msg->WriteInt(GetTickCount());
464 msg->WriteInt(msgid); 464 msg->WriteInt(msgid);
465 msg->WriteString(payload); 465 msg->WriteString(payload);
466 channel_->Send(msg); 466 channel_->Send(msg);
467 return true; 467 return true;
468 } 468 }
469
469 private: 470 private:
470 IPC::Channel *channel_; 471 IPC::Channel *channel_;
471 int count_messages_; 472 int count_messages_;
472 int latency_messages_; 473 int latency_messages_;
473 }; 474 };
474 475
475 class ChannelPerfListener : public IPC::Channel::Listener { 476 class ChannelPerfListener : public IPC::Channel::Listener {
476 public: 477 public:
477 ChannelPerfListener(IPC::Channel* channel, int msg_count, int msg_size) : 478 ChannelPerfListener(IPC::Channel* channel, int msg_count, int msg_size) :
478 count_down_(msg_count), 479 count_down_(msg_count),
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 #endif // PERFORMANCE_TEST 579 #endif // PERFORMANCE_TEST
579 580
580 int main(int argc, char** argv) { 581 int main(int argc, char** argv) {
581 #ifdef PERFORMANCE_TEST 582 #ifdef PERFORMANCE_TEST
582 int retval = base::PerfTestSuite(argc, argv).Run(); 583 int retval = base::PerfTestSuite(argc, argv).Run();
583 #else 584 #else
584 int retval = base::TestSuite(argc, argv).Run(); 585 int retval = base::TestSuite(argc, argv).Run();
585 #endif 586 #endif
586 return retval; 587 return retval;
587 } 588 }
OLDNEW
« no previous file with comments | « content/public/browser/utility_process_host.h ('k') | net/test/test_server_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698