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

Side by Side Diff: ppapi/proxy/ppapi_proxy_test.cc

Issue 1154613006: Update pepper to not assume that SharedMemoryHandle is an int. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another nits pass. 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
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 "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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 IPC::PlatformFileForTransit 249 IPC::PlatformFileForTransit
250 PluginProxyTestHarness::PluginDelegateMock::ShareHandleWithRemote( 250 PluginProxyTestHarness::PluginDelegateMock::ShareHandleWithRemote(
251 base::PlatformFile handle, 251 base::PlatformFile handle,
252 base::ProcessId /* remote_pid */, 252 base::ProcessId /* remote_pid */,
253 bool should_close_source) { 253 bool should_close_source) {
254 return IPC::GetFileHandleForProcess(handle, 254 return IPC::GetFileHandleForProcess(handle,
255 base::GetCurrentProcessHandle(), 255 base::GetCurrentProcessHandle(),
256 should_close_source); 256 should_close_source);
257 } 257 }
258 258
259 base::SharedMemoryHandle
260 PluginProxyTestHarness::PluginDelegateMock::ShareSharedMemoryHandleWithRemote(
261 const base::SharedMemoryHandle& handle,
262 base::ProcessId remote_pid) {
263 #if defined(OS_POSIX)
264 return ShareHandleWithRemote(handle.fd, remote_pid, false);
265 #elif defined(OS_WIN)
266 return ShareHandleWithRemote(handle, remote_pid, false);
267 #else
268 #error Not implemented.
269 #endif
270 }
271
259 std::set<PP_Instance>* 272 std::set<PP_Instance>*
260 PluginProxyTestHarness::PluginDelegateMock::GetGloballySeenInstanceIDSet() { 273 PluginProxyTestHarness::PluginDelegateMock::GetGloballySeenInstanceIDSet() {
261 return &instance_id_set_; 274 return &instance_id_set_;
262 } 275 }
263 276
264 uint32 PluginProxyTestHarness::PluginDelegateMock::Register( 277 uint32 PluginProxyTestHarness::PluginDelegateMock::Register(
265 PluginDispatcher* plugin_dispatcher) { 278 PluginDispatcher* plugin_dispatcher) {
266 return 0; 279 return 0;
267 } 280 }
268 281
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 IPC::PlatformFileForTransit 495 IPC::PlatformFileForTransit
483 HostProxyTestHarness::DelegateMock::ShareHandleWithRemote( 496 HostProxyTestHarness::DelegateMock::ShareHandleWithRemote(
484 base::PlatformFile handle, 497 base::PlatformFile handle,
485 base::ProcessId /* remote_pid */, 498 base::ProcessId /* remote_pid */,
486 bool should_close_source) { 499 bool should_close_source) {
487 return IPC::GetFileHandleForProcess(handle, 500 return IPC::GetFileHandleForProcess(handle,
488 base::GetCurrentProcessHandle(), 501 base::GetCurrentProcessHandle(),
489 should_close_source); 502 should_close_source);
490 } 503 }
491 504
505 base::SharedMemoryHandle
506 HostProxyTestHarness::DelegateMock::ShareSharedMemoryHandleWithRemote(
507 const base::SharedMemoryHandle& handle,
508 base::ProcessId remote_pid) {
509 #if defined(OS_POSIX)
510 return ShareHandleWithRemote(handle.fd, remote_pid, false);
511 #elif defined(OS_WIN)
512 return ShareHandleWithRemote(handle, remote_pid, false);
513 #else
514 #error Not implemented.
515 #endif
516 }
492 517
493 // HostProxyTest --------------------------------------------------------------- 518 // HostProxyTest ---------------------------------------------------------------
494 519
495 HostProxyTest::HostProxyTest() : HostProxyTestHarness(SINGLETON_GLOBALS) { 520 HostProxyTest::HostProxyTest() : HostProxyTestHarness(SINGLETON_GLOBALS) {
496 } 521 }
497 522
498 HostProxyTest::~HostProxyTest() { 523 HostProxyTest::~HostProxyTest() {
499 } 524 }
500 525
501 void HostProxyTest::SetUp() { 526 void HostProxyTest::SetUp() {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 plugin_thread_.message_loop_proxy()->PostTask(FROM_HERE, 602 plugin_thread_.message_loop_proxy()->PostTask(FROM_HERE,
578 base::Bind(&RunTaskOnRemoteHarness, 603 base::Bind(&RunTaskOnRemoteHarness,
579 task, 604 task,
580 &task_complete)); 605 &task_complete));
581 task_complete.Wait(); 606 task_complete.Wait();
582 } 607 }
583 608
584 609
585 } // namespace proxy 610 } // namespace proxy
586 } // namespace ppapi 611 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698