diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 18:59:20 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 18:59:20 +0000 |
commit | 5fe733dee6afd3ab897cafbfcdcc1450264409b0 (patch) | |
tree | 64d39f452e1aee1076356da52d836c902e8b92eb /chrome/common/ipc_message_utils.h | |
parent | 072f6f57560ab3616915b0aa9f61331deb2cf260 (diff) | |
download | chromium_src-5fe733dee6afd3ab897cafbfcdcc1450264409b0.zip chromium_src-5fe733dee6afd3ab897cafbfcdcc1450264409b0.tar.gz chromium_src-5fe733dee6afd3ab897cafbfcdcc1450264409b0.tar.bz2 |
POSIX: Transfer network data using shared memory
This patch adds the long planned support for sharing memory on POSIX
by transporting file descriptors. It largely builds on the shared
memory cleanup work by jrg.
We move FileDescriptor out of chrome/common/file_descriptor_posix.h
and into base/file_descriptor_posix.h. Since all that's left in the
chrome/common verion is the DescriptorSet, those files are renamed to
descriptor_set.[h|cc].
The SharedMemoryHandle on POSIX then becomes a typedef to a
FileDescriptor and thus can be serialised over IPC.
After that, it's mostly a case of cleaning up those snippets of code
which considered SharedMemoryHandles to be scaler values.
Review URL: http://codereview.chromium.org/21208
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_message_utils.h')
-rw-r--r-- | chrome/common/ipc_message_utils.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h index bd38df0..e7dd7e3 100644 --- a/chrome/common/ipc_message_utils.h +++ b/chrome/common/ipc_message_utils.h @@ -13,7 +13,7 @@ #include "base/string_util.h" #include "base/tuple.h" #if defined(OS_POSIX) -#include "chrome/common/file_descriptor_posix.h" +#include "chrome/common/descriptor_set_posix.h" #endif #include "chrome/common/ipc_sync_message.h" #include "chrome/common/thumbnail_score.h" @@ -668,13 +668,15 @@ struct ParamTraits<gfx::Size> { #if defined(OS_POSIX) template<> -struct ParamTraits<FileDescriptor> { - typedef FileDescriptor param_type; +struct ParamTraits<base::FileDescriptor> { + typedef base::FileDescriptor param_type; static void Write(Message* m, const param_type& p) { if (p.auto_close) { - m->descriptor_set()->AddAndAutoClose(p.fd); + if (!m->descriptor_set()->AddAndAutoClose(p.fd)) + NOTREACHED(); } else { - m->descriptor_set()->Add(p.fd); + if (!m->descriptor_set()->Add(p.fd)) + NOTREACHED(); } } static bool Read(const Message* m, void** iter, param_type* r) { |