| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/http/http_server_properties_impl.h" | 5 #include "net/http/http_server_properties_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "net/http/http_pipelined_host_capability.h" | 11 #include "net/http/http_pipelined_host_capability.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 // TODO(simonjam): Run experiments with different values of this to see what | 15 // TODO(simonjam): Run experiments with different values of this to see what |
| 16 // value is good at avoiding evictions without eating too much memory. Until | 16 // value is good at avoiding evictions without eating too much memory. Until |
| 17 // then, this is just a bad guess. | 17 // then, this is just a bad guess. |
| 18 static const int kDefaultNumHostsToRemember = 200; | 18 static const int kDefaultNumHostsToRemember = 200; |
| 19 | 19 |
| 20 HttpServerPropertiesImpl::HttpServerPropertiesImpl() | 20 HttpServerPropertiesImpl::HttpServerPropertiesImpl() |
| 21 : pipeline_capability_map_( | 21 : weak_ptr_factory_(this), |
| 22 new CachedPipelineCapabilityMap(kDefaultNumHostsToRemember)), | 22 pipeline_capability_map_( |
| 23 weak_ptr_factory_(this) { | 23 new CachedPipelineCapabilityMap(kDefaultNumHostsToRemember)) { |
| 24 } | 24 } |
| 25 | 25 |
| 26 HttpServerPropertiesImpl::~HttpServerPropertiesImpl() { | 26 HttpServerPropertiesImpl::~HttpServerPropertiesImpl() { |
| 27 } | 27 } |
| 28 | 28 |
| 29 void HttpServerPropertiesImpl::InitializeSpdyServers( | 29 void HttpServerPropertiesImpl::InitializeSpdyServers( |
| 30 std::vector<std::string>* spdy_servers, | 30 std::vector<std::string>* spdy_servers, |
| 31 bool support_spdy) { | 31 bool support_spdy) { |
| 32 DCHECK(CalledOnValidThread()); | 32 DCHECK(CalledOnValidThread()); |
| 33 spdy_servers_table_.clear(); | 33 spdy_servers_table_.clear(); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 PipelineCapabilityMap result; | 294 PipelineCapabilityMap result; |
| 295 CachedPipelineCapabilityMap::const_iterator it; | 295 CachedPipelineCapabilityMap::const_iterator it; |
| 296 for (it = pipeline_capability_map_->begin(); | 296 for (it = pipeline_capability_map_->begin(); |
| 297 it != pipeline_capability_map_->end(); ++it) { | 297 it != pipeline_capability_map_->end(); ++it) { |
| 298 result[it->first] = it->second; | 298 result[it->first] = it->second; |
| 299 } | 299 } |
| 300 return result; | 300 return result; |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace net | 303 } // namespace net |
| OLD | NEW |