Remove HttpServerProperies::GetWeakPtr().

Use HttpServerProperties* instead of WeakPtr<HttpServerProperties> everywhere
outside HttpServerProperties and its derived classes.

In production, IOThread (or IOSChromeIOThread) outlives everything that would
reference HttpServerProperties, so there are no lifetime issues.

As for tests, this CL ensures that in test base classes that own both an
HttpServerPropertiesImpl and an HttpNetworkSession instance, the former outlives
the latter.

BUG=508548

Review-Url: https://codereview.chromium.org/2041863002
Cr-Commit-Position: refs/heads/master@{#400660}
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index cf86f69..af48614 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -111,7 +111,7 @@
   session_deps->enable_alternative_service_with_different_host = true;
   if (test_params.ssl_type == HTTP_SPDY_VIA_ALT_SVC) {
     base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1);
-    session_deps->http_server_properties.SetAlternativeService(
+    session_deps->http_server_properties->SetAlternativeService(
         url::SchemeHostPort("http", "www.example.org", 80),
         AlternativeService(AlternateProtocolFromNextProto(test_params.protocol),
                            "www.example.org", 443),
@@ -4588,7 +4588,7 @@
   ssl_provider1->SetNextProto(kProtoHTTP11);
   helper.AddDataWithSSLSocketDataProvider(&data1, std::move(ssl_provider1));
 
-  base::WeakPtr<HttpServerProperties> http_server_properties =
+  HttpServerProperties* http_server_properties =
       helper.session()->spdy_session_pool()->http_server_properties();
   const HostPortPair host_port_pair = HostPortPair::FromURL(GURL(url));
   EXPECT_FALSE(http_server_properties->RequiresHTTP11(host_port_pair));
@@ -4693,7 +4693,7 @@
   helper.session_deps()->socket_factory->AddSSLSocketDataProvider(
       ssl_provider2.get());
 
-  base::WeakPtr<HttpServerProperties> http_server_properties =
+  HttpServerProperties* http_server_properties =
       helper.session()->spdy_session_pool()->http_server_properties();
   const HostPortPair proxy_host_port_pair = HostPortPair("myproxy", 70);
   EXPECT_FALSE(http_server_properties->RequiresHTTP11(proxy_host_port_pair));