Update CrOS OOBE throbber to MD throbber; delete old asset
[chromium-blink-merge.git] / chrome / common / local_discovery / local_discovery_messages.h
blobe597da3666de544923205bbc915b2e66cfd89c0a
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Defines local discovery messages between the browser and utility process.
7 // Multiple-included file, no traditional include guard.
8 #include <vector>
10 #include "chrome/common/local_discovery/service_discovery_client.h"
11 #include "ipc/ipc_message_macros.h"
13 #ifndef CHROME_COMMON_LOCAL_DISCOVERY_LOCAL_DISCOVERY_MESSAGES_H_
14 #define CHROME_COMMON_LOCAL_DISCOVERY_LOCAL_DISCOVERY_MESSAGES_H_
16 #if defined(OS_POSIX)
17 #include "base/file_descriptor_posix.h"
18 #endif
20 #if defined(OS_POSIX)
21 struct LocalDiscoveryMsg_SocketInfo {
22 LocalDiscoveryMsg_SocketInfo()
23 : address_family(net::ADDRESS_FAMILY_UNSPECIFIED),
24 interface_index(0) {
27 base::FileDescriptor descriptor;
28 net::AddressFamily address_family;
29 uint32 interface_index;
31 #endif // OS_POSIX
33 #endif // CHROME_COMMON_LOCAL_DISCOVERY_LOCAL_DISCOVERY_MESSAGES_H_
35 #define IPC_MESSAGE_START LocalDiscoveryMsgStart
37 IPC_ENUM_TRAITS_MAX_VALUE(local_discovery::ServiceWatcher::UpdateType,
38 local_discovery::ServiceWatcher::UPDATE_TYPE_LAST)
40 IPC_ENUM_TRAITS_MAX_VALUE(
41 local_discovery::ServiceResolver::RequestStatus,
42 local_discovery::ServiceResolver::REQUEST_STATUS_LAST)
44 IPC_ENUM_TRAITS_MAX_VALUE(net::AddressFamily, net::ADDRESS_FAMILY_LAST)
46 IPC_STRUCT_TRAITS_BEGIN(local_discovery::ServiceDescription)
47 IPC_STRUCT_TRAITS_MEMBER(service_name)
48 IPC_STRUCT_TRAITS_MEMBER(address)
49 IPC_STRUCT_TRAITS_MEMBER(metadata)
50 IPC_STRUCT_TRAITS_MEMBER(ip_address)
51 IPC_STRUCT_TRAITS_MEMBER(last_seen)
52 IPC_STRUCT_TRAITS_END()
54 #if defined(OS_POSIX)
55 IPC_STRUCT_TRAITS_BEGIN(LocalDiscoveryMsg_SocketInfo)
56 IPC_STRUCT_TRAITS_MEMBER(descriptor)
57 IPC_STRUCT_TRAITS_MEMBER(address_family)
58 IPC_STRUCT_TRAITS_MEMBER(interface_index)
59 IPC_STRUCT_TRAITS_END()
60 #endif // OS_POSIX
61 //------------------------------------------------------------------------------
62 // Utility process messages:
63 // These are messages from the browser to the utility process.
65 #if defined(OS_POSIX)
66 IPC_MESSAGE_CONTROL1(LocalDiscoveryMsg_SetSockets,
67 std::vector<LocalDiscoveryMsg_SocketInfo> /* sockets */)
68 #endif // OS_POSIX
70 // Creates watcher and starts listening in utility process.
71 IPC_MESSAGE_CONTROL2(LocalDiscoveryMsg_StartWatcher,
72 uint64 /* id */,
73 std::string /* service_type */)
75 // Discovers new services.
76 IPC_MESSAGE_CONTROL2(LocalDiscoveryMsg_DiscoverServices,
77 uint64 /* id */,
78 bool /* force_update */)
80 // Discovers new services.
81 IPC_MESSAGE_CONTROL2(LocalDiscoveryMsg_SetActivelyRefreshServices,
82 uint64 /* id */,
83 bool /* actively_refresh_services */)
85 // Destroys watcher in utility process.
86 IPC_MESSAGE_CONTROL1(LocalDiscoveryMsg_DestroyWatcher,
87 uint64 /* id */)
89 // Creates service resolver and starts resolving service in utility process.
90 IPC_MESSAGE_CONTROL2(LocalDiscoveryMsg_ResolveService,
91 uint64 /* id */,
92 std::string /* service_name */)
94 // Destroys service resolver in utility process.
95 IPC_MESSAGE_CONTROL1(LocalDiscoveryMsg_DestroyResolver,
96 uint64 /* id */)
98 // Creates a local domain resolver and starts resolving in utility process.
99 IPC_MESSAGE_CONTROL3(LocalDiscoveryMsg_ResolveLocalDomain,
100 uint64 /* id */,
101 std::string /* domain */,
102 net::AddressFamily /* address_family */)
104 // Destroys local domain resolver in utility process.
105 IPC_MESSAGE_CONTROL1(LocalDiscoveryMsg_DestroyLocalDomainResolver,
106 uint64 /* id */)
108 // Stops local discovery in utility process. http://crbug.com/268466.
109 IPC_MESSAGE_CONTROL0(LocalDiscoveryMsg_ShutdownLocalDiscovery)
112 //------------------------------------------------------------------------------
113 // Utility process host messages:
114 // These are messages from the utility process to the browser.
116 // Notifies browser process if process failed.
117 IPC_MESSAGE_CONTROL0(LocalDiscoveryHostMsg_Error)
119 // Notifies browser process about new services.
120 IPC_MESSAGE_CONTROL3(LocalDiscoveryHostMsg_WatcherCallback,
121 uint64 /* id */,
122 local_discovery::ServiceWatcher::UpdateType /* update */,
123 std::string /* service_name */)
125 // Notifies browser process about service resolution results.
126 IPC_MESSAGE_CONTROL3(
127 LocalDiscoveryHostMsg_ResolverCallback,
128 uint64 /* id */,
129 local_discovery::ServiceResolver::RequestStatus /* status */,
130 local_discovery::ServiceDescription /* description */)
132 // Notifies browser process about local domain resolution results.
133 IPC_MESSAGE_CONTROL4(
134 LocalDiscoveryHostMsg_LocalDomainResolverCallback,
135 uint64 /* id */,
136 bool /* success */,
137 net::IPAddressNumber /* ip_address_ipv4 */,
138 net::IPAddressNumber /* ip_address_ipv6 */)