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

Unified Diff: ppapi/proxy/proxy_channel.cc

Issue 7044095: Hooking MHTML generation to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_platform_file.cc ('k') | webkit/database/vfs_backend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/proxy_channel.cc
diff --git a/ppapi/proxy/proxy_channel.cc b/ppapi/proxy/proxy_channel.cc
index 0bce0413b11c0066b2769e9e169535b3b8addf90..d304dcabe197e834804adffe800681223557b0e4 100644
--- a/ppapi/proxy/proxy_channel.cc
+++ b/ppapi/proxy/proxy_channel.cc
@@ -4,6 +4,7 @@
#include "ppapi/proxy/proxy_channel.h"
+#include "ipc/ipc_platform_file.h"
#include "ipc/ipc_test_sink.h"
namespace pp {
@@ -49,28 +50,8 @@ int ProxyChannel::GetRendererFD() {
IPC::PlatformFileForTransit ProxyChannel::ShareHandleWithRemote(
base::PlatformFile handle,
bool should_close_source) {
- IPC::PlatformFileForTransit out_handle;
-#if defined(OS_WIN)
- DWORD options = DUPLICATE_SAME_ACCESS;
- if (should_close_source)
- options |= DUPLICATE_CLOSE_SOURCE;
- if (!::DuplicateHandle(::GetCurrentProcess(),
- handle,
- remote_process_handle_,
- &out_handle,
- 0,
- FALSE,
- options))
- out_handle = IPC::InvalidPlatformFileForTransit();
-#elif defined(OS_POSIX)
- // If asked to close the source, we can simply re-use the source fd instead of
- // dup()ing and close()ing.
- int fd = should_close_source ? handle : ::dup(handle);
- out_handle = base::FileDescriptor(fd, true);
-#else
- #error Not implemented.
-#endif
- return out_handle;
+ return IPC::GetFileHandleForProcess(handle, remote_process_handle_,
+ should_close_source);
}
bool ProxyChannel::Send(IPC::Message* msg) {
« no previous file with comments | « ipc/ipc_platform_file.cc ('k') | webkit/database/vfs_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698