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 "ppapi/proxy/ppapi_proxy_test.h" | 5 #include "ppapi/proxy/ppapi_proxy_test.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 local_harness_ = &plugin_; | 530 local_harness_ = &plugin_; |
531 } | 531 } |
532 } | 532 } |
533 | 533 |
534 TwoWayTest::~TwoWayTest() { | 534 TwoWayTest::~TwoWayTest() { |
535 shutdown_event_.Signal(); | 535 shutdown_event_.Signal(); |
536 } | 536 } |
537 | 537 |
538 void TwoWayTest::SetUp() { | 538 void TwoWayTest::SetUp() { |
539 base::Thread::Options options; | 539 base::Thread::Options options; |
540 options.message_loop_type = MessageLoop::TYPE_IO; | 540 options.message_loop_type = base::MessageLoop::TYPE_IO; |
541 io_thread_.StartWithOptions(options); | 541 io_thread_.StartWithOptions(options); |
542 plugin_thread_.Start(); | 542 plugin_thread_.Start(); |
543 | 543 |
544 // Construct the IPC handle name using the process ID so we can safely run | 544 // Construct the IPC handle name using the process ID so we can safely run |
545 // multiple |TwoWayTest|s concurrently. | 545 // multiple |TwoWayTest|s concurrently. |
546 std::ostringstream handle_name; | 546 std::ostringstream handle_name; |
547 handle_name << "TwoWayTestChannel" << base::GetCurrentProcId(); | 547 handle_name << "TwoWayTestChannel" << base::GetCurrentProcId(); |
548 IPC::ChannelHandle handle(handle_name.str()); | 548 IPC::ChannelHandle handle(handle_name.str()); |
549 base::WaitableEvent remote_harness_set_up(true, false); | 549 base::WaitableEvent remote_harness_set_up(true, false); |
550 plugin_thread_.message_loop_proxy()->PostTask( | 550 plugin_thread_.message_loop_proxy()->PostTask( |
(...skipping 30 matching lines...) Expand all Loading... |
581 plugin_thread_.message_loop_proxy()->PostTask(FROM_HERE, | 581 plugin_thread_.message_loop_proxy()->PostTask(FROM_HERE, |
582 base::Bind(&RunTaskOnRemoteHarness, | 582 base::Bind(&RunTaskOnRemoteHarness, |
583 task, | 583 task, |
584 &task_complete)); | 584 &task_complete)); |
585 task_complete.Wait(); | 585 task_complete.Wait(); |
586 } | 586 } |
587 | 587 |
588 | 588 |
589 } // namespace proxy | 589 } // namespace proxy |
590 } // namespace ppapi | 590 } // namespace ppapi |
OLD | NEW |