diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 10:53:06 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 10:53:06 +0000 |
commit | 90d321483e44d328b38b2f9f4771982634ddb546 (patch) | |
tree | b1d437137afefc2d2693a070545be065b74a8c59 /chrome/common/local_discovery/local_discovery_messages.h | |
parent | c49c636f06ca510f6cbd16087f84950f7484d827 (diff) | |
download | chromium_src-90d321483e44d328b38b2f9f4771982634ddb546.zip chromium_src-90d321483e44d328b38b2f9f4771982634ddb546.tar.gz chromium_src-90d321483e44d328b38b2f9f4771982634ddb546.tar.bz2 |
Use all interfaces for mdns. Instead of one IPv4 and one IPv6 sockets mdns uses one socket per network interface and IP protocol.
Windows version enumerate network interfaces during pre-sandbox initialization in Utility process. It creates and store socket pert interface and IP protocols version. Late these sockets will be used be MDnsSocketFactory implementation.
Linux version enumerates network in browser process before starting utility process. Then sockets will be sent by IPC to utility process and used by MDnsSocketFactory implementation.
BUG=319068
Review URL: https://codereview.chromium.org/101083003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/local_discovery/local_discovery_messages.h')
-rw-r--r-- | chrome/common/local_discovery/local_discovery_messages.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/chrome/common/local_discovery/local_discovery_messages.h b/chrome/common/local_discovery/local_discovery_messages.h index 1add9a2..61678ec 100644 --- a/chrome/common/local_discovery/local_discovery_messages.h +++ b/chrome/common/local_discovery/local_discovery_messages.h @@ -4,10 +4,30 @@ // Defines local discovery messages between the browser and utility process. +#include <vector> + #include "base/file_descriptor_posix.h" #include "chrome/common/local_discovery/service_discovery_client.h" #include "ipc/ipc_message_macros.h" +#ifndef CHROME_COMMON_LOCAL_DISCOVERY_LOCAL_DISCOVERY_MESSAGES_H_ +#define CHROME_COMMON_LOCAL_DISCOVERY_LOCAL_DISCOVERY_MESSAGES_H_ + +#if defined(OS_POSIX) +struct LocalDiscoveryMsg_SocketInfo { + LocalDiscoveryMsg_SocketInfo() + : address_family(net::ADDRESS_FAMILY_UNSPECIFIED), + interface_index(0) { + } + + base::FileDescriptor descriptor; + net::AddressFamily address_family; + uint32 interface_index; +}; +#endif // OS_POSIX + +#endif // CHROME_COMMON_LOCAL_DISCOVERY_LOCAL_DISCOVERY_MESSAGES_H_ + #define IPC_MESSAGE_START LocalDiscoveryMsgStart IPC_STRUCT_TRAITS_BEGIN(local_discovery::ServiceDescription) @@ -22,14 +42,20 @@ IPC_ENUM_TRAITS(local_discovery::ServiceWatcher::UpdateType) IPC_ENUM_TRAITS(local_discovery::ServiceResolver::RequestStatus) IPC_ENUM_TRAITS(net::AddressFamily) +#if defined(OS_POSIX) +IPC_STRUCT_TRAITS_BEGIN(LocalDiscoveryMsg_SocketInfo) + IPC_STRUCT_TRAITS_MEMBER(descriptor) + IPC_STRUCT_TRAITS_MEMBER(address_family) + IPC_STRUCT_TRAITS_MEMBER(interface_index) +IPC_STRUCT_TRAITS_END() +#endif // OS_POSIX //------------------------------------------------------------------------------ // Utility process messages: // These are messages from the browser to the utility process. #if defined(OS_POSIX) -IPC_MESSAGE_CONTROL2(LocalDiscoveryMsg_SetSockets, - base::FileDescriptor /* socket4 */, - base::FileDescriptor /* socket6 */) +IPC_MESSAGE_CONTROL1(LocalDiscoveryMsg_SetSockets, + std::vector<LocalDiscoveryMsg_SocketInfo> /* sockets */) #endif // OS_POSIX // Creates watcher and starts listening in utility process. |