| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/quic/chromium/properties_based_quic_server_info.h" | 5 #include "net/quic/chromium/properties_based_quic_server_info.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 RecordQuicServerInfoStatus(QUIC_SERVER_INFO_PERSIST); | 87 RecordQuicServerInfoStatus(QUIC_SERVER_INFO_PERSIST); |
| 88 string encoded; | 88 string encoded; |
| 89 base::Base64Encode(Serialize(), &encoded); | 89 base::Base64Encode(Serialize(), &encoded); |
| 90 http_server_properties_->SetQuicServerInfo(server_id_, encoded); | 90 http_server_properties_->SetQuicServerInfo(server_id_, encoded); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void PropertiesBasedQuicServerInfo::OnExternalCacheHit() { | 93 void PropertiesBasedQuicServerInfo::OnExternalCacheHit() { |
| 94 RecordQuicServerInfoStatus(QUIC_SERVER_INFO_EXTERNAL_CACHE_HIT); | 94 RecordQuicServerInfoStatus(QUIC_SERVER_INFO_EXTERNAL_CACHE_HIT); |
| 95 } | 95 } |
| 96 | 96 |
| 97 size_t PropertiesBasedQuicServerInfo::EstimateMemoryUsage() const { |
| 98 return 0; |
| 99 } |
| 100 |
| 97 PropertiesBasedQuicServerInfoFactory::PropertiesBasedQuicServerInfoFactory( | 101 PropertiesBasedQuicServerInfoFactory::PropertiesBasedQuicServerInfoFactory( |
| 98 HttpServerProperties* http_server_properties) | 102 HttpServerProperties* http_server_properties) |
| 99 : http_server_properties_(http_server_properties) {} | 103 : http_server_properties_(http_server_properties) {} |
| 100 | 104 |
| 101 PropertiesBasedQuicServerInfoFactory::~PropertiesBasedQuicServerInfoFactory() {} | 105 PropertiesBasedQuicServerInfoFactory::~PropertiesBasedQuicServerInfoFactory() {} |
| 102 | 106 |
| 103 std::unique_ptr<QuicServerInfo> | 107 std::unique_ptr<QuicServerInfo> |
| 104 PropertiesBasedQuicServerInfoFactory::GetForServer( | 108 PropertiesBasedQuicServerInfoFactory::GetForServer( |
| 105 const QuicServerId& server_id) { | 109 const QuicServerId& server_id) { |
| 106 return base::MakeUnique<PropertiesBasedQuicServerInfo>( | 110 return base::MakeUnique<PropertiesBasedQuicServerInfo>( |
| 107 server_id, http_server_properties_); | 111 server_id, http_server_properties_); |
| 108 } | 112 } |
| 109 | 113 |
| 110 } // namespace net | 114 } // namespace net |
| OLD | NEW |