diff options
author | Iain Merrick <husky@google.com> | 2010-10-13 15:07:26 +0100 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-10-19 14:37:57 +0100 |
commit | dd0e069b1c2e5079f99024c4d54c7d06ef81d11b (patch) | |
tree | 9246dc13dc5df6a7926fabacc06496e5c2c1ade7 | |
parent | 90d7822561da7131cc2f3ba0415750e659b7b8e4 (diff) | |
download | external_chromium-dd0e069b1c2e5079f99024c4d54c7d06ef81d11b.zip external_chromium-dd0e069b1c2e5079f99024c4d54c7d06ef81d11b.tar.gz external_chromium-dd0e069b1c2e5079f99024c4d54c7d06ef81d11b.tar.bz2 |
Merge Chromium at 7.0.540.0 : Fix networking code.
Linux-specific code in dnsrr_resolver.cc doesn't compile on Android.
http://src.chromium.org/viewvc/chrome?view=rev&revision=54907
NetLog added to HostResolver, fixing Android-specific code.
http://src.chromium.org/viewvc/chrome?view=rev&revision=57189
Linux-specific IPv6 code in net_util.cc doesn't compile on Android.
http://src.chromium.org/viewvc/chrome?view=rev&revision=41743
Not including SSL false start blacklist on Android to reduce bloat.
http://src.chromium.org/viewvc/chrome?view=rev&revision=58824
ProxyConfigServiceNull is still used on unsupported platforms.
This is a bug in Chromium. Reverting its deletion.
http://src.chromium.org/viewvc/chrome?view=rev&revision=59362
Added virtual destructor to DNSSECPRovider in ssl_client_socket.h
This has already been done for other Chrome classes, should be easy
to upstream.
Change-Id: I158fc709c295712dc35c4172708a294f65a381a4
-rw-r--r-- | net/base/dnsrr_resolver.cc | 4 | ||||
-rw-r--r-- | net/base/host_resolver.cc | 2 | ||||
-rw-r--r-- | net/base/host_resolver_impl.cc | 10 | ||||
-rw-r--r-- | net/base/net_util.cc | 5 | ||||
-rw-r--r-- | net/base/ssl_config_service.cc | 4 | ||||
-rw-r--r-- | net/proxy/proxy_service.cc | 13 | ||||
-rw-r--r-- | net/socket/ssl_client_socket.h | 5 |
7 files changed, 35 insertions, 8 deletions
diff --git a/net/base/dnsrr_resolver.cc b/net/base/dnsrr_resolver.cc index dbbb0af..8b723dd 100644 --- a/net/base/dnsrr_resolver.cc +++ b/net/base/dnsrr_resolver.cc @@ -76,7 +76,7 @@ class CompletionCallbackTask : public Task, MessageLoop* message_loop_; }; -#if defined(OS_POSIX) +#if defined(OS_POSIX) && !defined(ANDROID) class ResolveTask : public Task { public: ResolveTask(const std::string& name, uint16 rrtype, @@ -313,7 +313,7 @@ class Buffer { bool RRResponse::ParseFromResponse(const uint8* p, unsigned len, uint16 rrtype_requested) { -#if defined(OS_POSIX) +#if defined(OS_POSIX) && !defined(ANDROID) name.clear(); ttl = 0; dnssec = false; diff --git a/net/base/host_resolver.cc b/net/base/host_resolver.cc index 5836c65..c64df01 100644 --- a/net/base/host_resolver.cc +++ b/net/base/host_resolver.cc @@ -51,7 +51,7 @@ int SingleRequestHostResolver::Resolve(const HostResolver::RequestInfo& info, CompletionCallback* transient_callback = callback ? &callback_ : NULL; #ifdef ANDROID - HostResolver* hr = CreateSystemHostResolver(NULL); + HostResolver* hr = CreateSystemHostResolver(HostResolver::kDefaultParallelism, NULL); int rv = hr->Resolve(info, addresses, transient_callback, &request, net_log); #else int rv = resolver_->Resolve( diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc index a6ecc41..21d032e 100644 --- a/net/base/host_resolver_impl.cc +++ b/net/base/host_resolver_impl.cc @@ -52,7 +52,6 @@ HostCache* CreateDefaultCache() { return cache; } -HostResolver* systemResolver = NULL; } // anonymous namespace @@ -61,6 +60,7 @@ HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves, // Maximum of 50 concurrent threads. // TODO(eroman): Adjust this, do some A/B experiments. #ifdef ANDROID + static HostResolver* systemResolver = NULL; static const size_t kDefaultMaxJobs = 4u; #else static const size_t kDefaultMaxJobs = 50u; @@ -73,14 +73,16 @@ HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves, // TODO: Clean this up! if (!systemResolver) systemResolver = new HostResolverImpl( - NULL, CreateDefaultCache(), max_concurrent_resolves); + NULL, CreateDefaultCache(), max_concurrent_resolves, net_log); + + return systemResolver; #else HostResolverImpl* resolver = new HostResolverImpl(NULL, CreateDefaultCache(), max_concurrent_resolves, net_log); -#endif - return systemResolver; + return resolver; +#endif } static int ResolveAddrInfo(HostResolverProc* resolver_proc, diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 29c76bb..eea5a97 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -1824,7 +1824,10 @@ bool IPv6Supported() { } bool HaveOnlyLoopbackAddresses() { -#if defined(OS_POSIX) +#if defined(ANDROID) + // Android has no <ifaddrs.h> + return false; +#elif defined(OS_POSIX) struct ifaddrs* interface_addr = NULL; int rv = getifaddrs(&interface_addr); if (rv != 0) { diff --git a/net/base/ssl_config_service.cc b/net/base/ssl_config_service.cc index c20284f..dabf1b7 100644 --- a/net/base/ssl_config_service.cc +++ b/net/base/ssl_config_service.cc @@ -84,7 +84,11 @@ bool SSLConfigService::IsKnownStrictTLSServer(const std::string& hostname) { // static bool SSLConfigService::IsKnownFalseStartIncompatibleServer( const std::string& hostname) { +#ifdef ANDROID + return true; +#else return SSLFalseStartBlacklist::IsMember(hostname.c_str()); +#endif } static bool g_dnssec_enabled = false; diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index c4226ff..6a53605 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -85,6 +85,19 @@ const size_t kDefaultNumPacThreads = 4; // setups. const int64 kNumMillisToStallAfterNetworkChanges = 2000; +#ifdef ANDROID +// Config getter that fails every time. +class ProxyConfigServiceNull : public ProxyConfigService { + public: + // ProxyConfigService implementation: + virtual void AddObserver(Observer* observer) {} + virtual void RemoveObserver(Observer* observer) {} + virtual bool GetLatestProxyConfig(ProxyConfig* config) { + return false; + } +}; +#endif + // Config getter that always returns direct settings. class ProxyConfigServiceDirect : public ProxyConfigService { public: diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h index 064dd26..de521db 100644 --- a/net/socket/ssl_client_socket.h +++ b/net/socket/ssl_client_socket.h @@ -30,6 +30,11 @@ class DNSSECProvider { // function will return OK if called again. virtual int GetDNSSECRecords(RRResponse** out, CompletionCallback* callback) = 0; + +#ifdef ANDROID + protected: + virtual ~DNSSECProvider() {} +#endif }; // A client socket that uses SSL as the transport layer. |