| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/disk_cache_based_quic_server_info.h" | 5 #include "net/http/disk_cache_based_quic_server_info.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/metrics/histogram_macros.h" | 11 #include "base/metrics/histogram_macros.h" |
| 12 #include "net/base/completion_callback.h" | 12 #include "net/base/completion_callback.h" |
| 13 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
| 14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 15 #include "net/http/http_cache.h" | 15 #include "net/http/http_cache.h" |
| 16 #include "net/http/http_network_session.h" | 16 #include "net/http/http_network_session.h" |
| 17 #include "net/quic/quic_server_id.h" | 17 #include "net/quic/core/quic_server_id.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 // Some APIs inside disk_cache take a handle that the caller must keep alive | 21 // Some APIs inside disk_cache take a handle that the caller must keep alive |
| 22 // until the API has finished its asynchronous execution. | 22 // until the API has finished its asynchronous execution. |
| 23 // | 23 // |
| 24 // Unfortunately, DiskCacheBasedQuicServerInfo may be deleted before the | 24 // Unfortunately, DiskCacheBasedQuicServerInfo may be deleted before the |
| 25 // operation completes causing a use-after-free. | 25 // operation completes causing a use-after-free. |
| 26 // | 26 // |
| 27 // This data shim struct is meant to provide a location for the disk_cache | 27 // This data shim struct is meant to provide a location for the disk_cache |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 } else if (backend_->GetCacheType() == MEMORY_CACHE) { | 428 } else if (backend_->GetCacheType() == MEMORY_CACHE) { |
| 429 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.MemoryCache", | 429 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.MemoryCache", |
| 430 failure, NUM_OF_FAILURES); | 430 failure, NUM_OF_FAILURES); |
| 431 } else { | 431 } else { |
| 432 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.DiskCache", | 432 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.DiskCache", |
| 433 failure, NUM_OF_FAILURES); | 433 failure, NUM_OF_FAILURES); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 | 436 |
| 437 } // namespace net | 437 } // namespace net |
| OLD | NEW |