| 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" |
| 11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/message_loop/message_loop_proxy.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "base/process/process_handle.h" |
| 13 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 14 #include "ipc/ipc_sync_channel.h" | 15 #include "ipc/ipc_sync_channel.h" |
| 15 #include "ipc/message_filter.h" | 16 #include "ipc/message_filter.h" |
| 16 #include "ppapi/c/pp_errors.h" | 17 #include "ppapi/c/pp_errors.h" |
| 17 #include "ppapi/c/private/ppb_proxy_private.h" | 18 #include "ppapi/c/private/ppb_proxy_private.h" |
| 18 #include "ppapi/proxy/ppapi_messages.h" | 19 #include "ppapi/proxy/ppapi_messages.h" |
| 19 #include "ppapi/proxy/ppb_message_loop_proxy.h" | 20 #include "ppapi/proxy/ppb_message_loop_proxy.h" |
| 20 #include "ppapi/shared_impl/proxy_lock.h" | 21 #include "ppapi/shared_impl/proxy_lock.h" |
| 21 | 22 |
| 22 namespace ppapi { | 23 namespace ppapi { |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 PluginProxyTestHarness::PluginDelegateMock::GetShutdownEvent() { | 247 PluginProxyTestHarness::PluginDelegateMock::GetShutdownEvent() { |
| 247 return shutdown_event_; | 248 return shutdown_event_; |
| 248 } | 249 } |
| 249 | 250 |
| 250 IPC::PlatformFileForTransit | 251 IPC::PlatformFileForTransit |
| 251 PluginProxyTestHarness::PluginDelegateMock::ShareHandleWithRemote( | 252 PluginProxyTestHarness::PluginDelegateMock::ShareHandleWithRemote( |
| 252 base::PlatformFile handle, | 253 base::PlatformFile handle, |
| 253 base::ProcessId /* remote_pid */, | 254 base::ProcessId /* remote_pid */, |
| 254 bool should_close_source) { | 255 bool should_close_source) { |
| 255 return IPC::GetFileHandleForProcess(handle, | 256 return IPC::GetFileHandleForProcess(handle, |
| 256 base::Process::Current().handle(), | 257 base::GetCurrentProcessHandle(), |
| 257 should_close_source); | 258 should_close_source); |
| 258 } | 259 } |
| 259 | 260 |
| 260 std::set<PP_Instance>* | 261 std::set<PP_Instance>* |
| 261 PluginProxyTestHarness::PluginDelegateMock::GetGloballySeenInstanceIDSet() { | 262 PluginProxyTestHarness::PluginDelegateMock::GetGloballySeenInstanceIDSet() { |
| 262 return &instance_id_set_; | 263 return &instance_id_set_; |
| 263 } | 264 } |
| 264 | 265 |
| 265 uint32 PluginProxyTestHarness::PluginDelegateMock::Register( | 266 uint32 PluginProxyTestHarness::PluginDelegateMock::Register( |
| 266 PluginDispatcher* plugin_dispatcher) { | 267 PluginDispatcher* plugin_dispatcher) { |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 base::WaitableEvent* HostProxyTestHarness::DelegateMock::GetShutdownEvent() { | 483 base::WaitableEvent* HostProxyTestHarness::DelegateMock::GetShutdownEvent() { |
| 483 return shutdown_event_; | 484 return shutdown_event_; |
| 484 } | 485 } |
| 485 | 486 |
| 486 IPC::PlatformFileForTransit | 487 IPC::PlatformFileForTransit |
| 487 HostProxyTestHarness::DelegateMock::ShareHandleWithRemote( | 488 HostProxyTestHarness::DelegateMock::ShareHandleWithRemote( |
| 488 base::PlatformFile handle, | 489 base::PlatformFile handle, |
| 489 base::ProcessId /* remote_pid */, | 490 base::ProcessId /* remote_pid */, |
| 490 bool should_close_source) { | 491 bool should_close_source) { |
| 491 return IPC::GetFileHandleForProcess(handle, | 492 return IPC::GetFileHandleForProcess(handle, |
| 492 base::Process::Current().handle(), | 493 base::GetCurrentProcessHandle(), |
| 493 should_close_source); | 494 should_close_source); |
| 494 } | 495 } |
| 495 | 496 |
| 496 | 497 |
| 497 // HostProxyTest --------------------------------------------------------------- | 498 // HostProxyTest --------------------------------------------------------------- |
| 498 | 499 |
| 499 HostProxyTest::HostProxyTest() : HostProxyTestHarness(SINGLETON_GLOBALS) { | 500 HostProxyTest::HostProxyTest() : HostProxyTestHarness(SINGLETON_GLOBALS) { |
| 500 } | 501 } |
| 501 | 502 |
| 502 HostProxyTest::~HostProxyTest() { | 503 HostProxyTest::~HostProxyTest() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 plugin_thread_.message_loop_proxy()->PostTask(FROM_HERE, | 582 plugin_thread_.message_loop_proxy()->PostTask(FROM_HERE, |
| 582 base::Bind(&RunTaskOnRemoteHarness, | 583 base::Bind(&RunTaskOnRemoteHarness, |
| 583 task, | 584 task, |
| 584 &task_complete)); | 585 &task_complete)); |
| 585 task_complete.Wait(); | 586 task_complete.Wait(); |
| 586 } | 587 } |
| 587 | 588 |
| 588 | 589 |
| 589 } // namespace proxy | 590 } // namespace proxy |
| 590 } // namespace ppapi | 591 } // namespace ppapi |
| OLD | NEW |