| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_HOST_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_HOST_CLIENT_H_ | 
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_HOST_CLIENT_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_HOST_CLIENT_H_ | 
| 7 | 7 | 
| 8 #include <map> | 8 #include <map> | 
| 9 #include <string> | 9 #include <string> | 
| 10 #include <vector> | 10 #include <vector> | 
| 11 | 11 | 
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" | 
| 13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" | 
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" | 
| 15 #include "chrome/common/local_discovery/service_discovery_client.h" | 15 #include "chrome/common/local_discovery/service_discovery_client.h" | 
| 16 #include "content/public/browser/utility_process_host_client.h" | 16 #include "content/public/browser/utility_process_host_client.h" | 
| 17 | 17 | 
| 18 struct LocalDiscoveryMsg_SocketInfo; | 18 struct LocalDiscoveryMsg_SocketInfo; | 
| 19 | 19 | 
| 20 namespace base { | 20 namespace base { | 
| 21 class TaskRunner; | 21 class TaskRunner; | 
| 22 } | 22 } | 
| 23 | 23 | 
|  | 24 namespace net { | 
|  | 25 class IPAddress; | 
|  | 26 } | 
|  | 27 | 
| 24 namespace content { | 28 namespace content { | 
| 25 class UtilityProcessHost; | 29 class UtilityProcessHost; | 
| 26 } | 30 } | 
| 27 | 31 | 
| 28 namespace local_discovery { | 32 namespace local_discovery { | 
| 29 | 33 | 
| 30 #if defined(OS_POSIX) | 34 #if defined(OS_POSIX) | 
| 31 typedef std::vector<LocalDiscoveryMsg_SocketInfo> SocketInfoList; | 35 typedef std::vector<LocalDiscoveryMsg_SocketInfo> SocketInfoList; | 
| 32 #endif  // OS_POSIX | 36 #endif  // OS_POSIX | 
| 33 | 37 | 
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 102   // IPC Message handlers. | 106   // IPC Message handlers. | 
| 103   void OnError(); | 107   void OnError(); | 
| 104   void OnWatcherCallback(uint64 id, | 108   void OnWatcherCallback(uint64 id, | 
| 105                          ServiceWatcher::UpdateType update, | 109                          ServiceWatcher::UpdateType update, | 
| 106                          const std::string& service_name); | 110                          const std::string& service_name); | 
| 107   void OnResolverCallback(uint64 id, | 111   void OnResolverCallback(uint64 id, | 
| 108                           ServiceResolver::RequestStatus status, | 112                           ServiceResolver::RequestStatus status, | 
| 109                           const ServiceDescription& description); | 113                           const ServiceDescription& description); | 
| 110   void OnLocalDomainResolverCallback(uint64 id, | 114   void OnLocalDomainResolverCallback(uint64 id, | 
| 111                                      bool success, | 115                                      bool success, | 
| 112                                      const net::IPAddressNumber& address_ipv4, | 116                                      const net::IPAddress& address_ipv4, | 
| 113                                      const net::IPAddressNumber& address_ipv6); | 117                                      const net::IPAddress& address_ipv6); | 
| 114 |  | 
| 115 | 118 | 
| 116   // Runs watcher callback on owning thread. | 119   // Runs watcher callback on owning thread. | 
| 117   void RunWatcherCallback(uint64 id, | 120   void RunWatcherCallback(uint64 id, | 
| 118                           ServiceWatcher::UpdateType update, | 121                           ServiceWatcher::UpdateType update, | 
| 119                           const std::string& service_name); | 122                           const std::string& service_name); | 
| 120   // Runs resolver callback on owning thread. | 123   // Runs resolver callback on owning thread. | 
| 121   void RunResolverCallback(uint64 id, | 124   void RunResolverCallback(uint64 id, | 
| 122                            ServiceResolver::RequestStatus status, | 125                            ServiceResolver::RequestStatus status, | 
| 123                            const ServiceDescription& description); | 126                            const ServiceDescription& description); | 
| 124   // Runs local domain resolver callback on owning thread. | 127   // Runs local domain resolver callback on owning thread. | 
| 125   void RunLocalDomainResolverCallback(uint64 id, | 128   void RunLocalDomainResolverCallback(uint64 id, | 
| 126                                       bool success, | 129                                       bool success, | 
| 127                                       const net::IPAddressNumber& address_ipv4, | 130                                       const net::IPAddress& address_ipv4, | 
| 128                                       const net::IPAddressNumber& address_ipv6); | 131                                       const net::IPAddress& address_ipv6); | 
| 129 |  | 
| 130 | 132 | 
| 131   base::WeakPtr<content::UtilityProcessHost> utility_host_; | 133   base::WeakPtr<content::UtilityProcessHost> utility_host_; | 
| 132 | 134 | 
| 133   // Incrementing counter to assign ID to watchers and resolvers. | 135   // Incrementing counter to assign ID to watchers and resolvers. | 
| 134   uint64 current_id_; | 136   uint64 current_id_; | 
| 135   base::Closure error_callback_; | 137   base::Closure error_callback_; | 
| 136   WatcherCallbacks service_watcher_callbacks_; | 138   WatcherCallbacks service_watcher_callbacks_; | 
| 137   ResolverCallbacks service_resolver_callbacks_; | 139   ResolverCallbacks service_resolver_callbacks_; | 
| 138   DomainResolverCallbacks domain_resolver_callbacks_; | 140   DomainResolverCallbacks domain_resolver_callbacks_; | 
| 139   scoped_refptr<base::TaskRunner> callback_runner_; | 141   scoped_refptr<base::TaskRunner> callback_runner_; | 
| 140   scoped_refptr<base::TaskRunner> io_runner_; | 142   scoped_refptr<base::TaskRunner> io_runner_; | 
| 141   ScopedVector<IPC::Message> delayed_messages_; | 143   ScopedVector<IPC::Message> delayed_messages_; | 
| 142 | 144 | 
| 143   DISALLOW_COPY_AND_ASSIGN(ServiceDiscoveryHostClient); | 145   DISALLOW_COPY_AND_ASSIGN(ServiceDiscoveryHostClient); | 
| 144 }; | 146 }; | 
| 145 | 147 | 
| 146 }  // namespace local_discovery | 148 }  // namespace local_discovery | 
| 147 | 149 | 
| 148 #endif  // CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_HOST_CLIENT_H_ | 150 #endif  // CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_HOST_CLIENT_H_ | 
| OLD | NEW | 
|---|