Broker out PPAPI handle duplication
BUG=127449
Review URL: https://chromiumcodereview.appspot.com/10378057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136686 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ppapi/proxy/proxy_channel.h b/ppapi/proxy/proxy_channel.h
index f32d470..424da94 100644
--- a/ppapi/proxy/proxy_channel.h
+++ b/ppapi/proxy/proxy_channel.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -38,6 +38,16 @@
// Returns the event object that becomes signalled when the main thread's
// message loop exits.
virtual base::WaitableEvent* GetShutdownEvent() = 0;
+
+ // Duplicates a handle to the provided object, returning one that is valid
+ // on the other side of the channel. This is part of the delegate interface
+ // because both sides of the channel may not have sufficient permission to
+ // duplicate handles directly. The implementation must provide the same
+ // guarantees as ProxyChannel::ShareHandleWithRemote below.
+ virtual IPC::PlatformFileForTransit ShareHandleWithRemote(
+ base::PlatformFile handle,
+ const IPC::SyncChannel& channel,
+ bool should_close_source) = 0;
};
virtual ~ProxyChannel();
@@ -73,7 +83,7 @@
#endif
protected:
- explicit ProxyChannel(base::ProcessHandle remote_process_handle);
+ explicit ProxyChannel();
// You must call this function before anything else. Returns true on success.
// The delegate pointer must outlive this class, ownership is not
@@ -90,8 +100,6 @@
// Non-owning pointer. Guaranteed non-NULL after init is called.
ProxyChannel::Delegate* delegate_;
- base::ProcessHandle remote_process_handle_; // See getter above.
-
// When we're unit testing, this will indicate the sink for the messages to
// be deposited so they can be inspected by the test. When non-NULL, this
// indicates that the channel should not be used.