| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
| 8 #include "base/port.h" | 8 #include "base/port.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 11 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| 12 #include "base/threading/platform_thread.h" | 12 #include "base/threading/platform_thread.h" |
| 13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 14 #include "net/base/cache_type.h" | 14 #include "net/base/cache_type.h" |
| 15 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
| 16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 17 #include "net/base/test_completion_callback.h" | 17 #include "net/base/test_completion_callback.h" |
| 18 #include "net/disk_cache/backend_impl.h" | 18 #include "net/disk_cache/blockfile/backend_impl.h" |
| 19 #include "net/disk_cache/blockfile/entry_impl.h" |
| 20 #include "net/disk_cache/blockfile/experiments.h" |
| 21 #include "net/disk_cache/blockfile/mapped_file.h" |
| 19 #include "net/disk_cache/cache_util.h" | 22 #include "net/disk_cache/cache_util.h" |
| 20 #include "net/disk_cache/disk_cache_test_base.h" | 23 #include "net/disk_cache/disk_cache_test_base.h" |
| 21 #include "net/disk_cache/disk_cache_test_util.h" | 24 #include "net/disk_cache/disk_cache_test_util.h" |
| 22 #include "net/disk_cache/entry_impl.h" | 25 #include "net/disk_cache/memory/mem_backend_impl.h" |
| 23 #include "net/disk_cache/experiments.h" | |
| 24 #include "net/disk_cache/mapped_file.h" | |
| 25 #include "net/disk_cache/mem_backend_impl.h" | |
| 26 #include "net/disk_cache/simple/simple_backend_impl.h" | 26 #include "net/disk_cache/simple/simple_backend_impl.h" |
| 27 #include "net/disk_cache/simple/simple_entry_format.h" | 27 #include "net/disk_cache/simple/simple_entry_format.h" |
| 28 #include "net/disk_cache/simple/simple_test_util.h" | 28 #include "net/disk_cache/simple/simple_test_util.h" |
| 29 #include "net/disk_cache/simple/simple_util.h" | 29 #include "net/disk_cache/simple/simple_util.h" |
| 30 #include "net/disk_cache/tracing_cache_backend.h" | 30 #include "net/disk_cache/tracing/tracing_cache_backend.h" |
| 31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
| 32 | 32 |
| 33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
| 34 #include "base/win/scoped_handle.h" | 34 #include "base/win/scoped_handle.h" |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 #define CACHE_HISTOGRAM_MACROS_BACKEND_IMPL_OBJ backend_ | 37 #define CACHE_HISTOGRAM_MACROS_BACKEND_IMPL_OBJ backend_ |
| 38 #include "net/disk_cache/histogram_macros.h" | 38 #include "net/disk_cache/blockfile/histogram_macros.h" |
| 39 | 39 |
| 40 using base::Time; | 40 using base::Time; |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| 43 | 43 |
| 44 const char kExistingEntryKey[] = "existing entry key"; | 44 const char kExistingEntryKey[] = "existing entry key"; |
| 45 | 45 |
| 46 scoped_ptr<disk_cache::BackendImpl> CreateExistingEntryCache( | 46 scoped_ptr<disk_cache::BackendImpl> CreateExistingEntryCache( |
| 47 const base::Thread& cache_thread, | 47 const base::Thread& cache_thread, |
| 48 base::FilePath& cache_path) { | 48 base::FilePath& cache_path) { |
| (...skipping 3438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3487 void* iter = NULL; | 3487 void* iter = NULL; |
| 3488 size_t count = 0; | 3488 size_t count = 0; |
| 3489 ASSERT_TRUE(EnumerateAndMatchKeys(-1, &iter, &keys_to_match, &count)); | 3489 ASSERT_TRUE(EnumerateAndMatchKeys(-1, &iter, &keys_to_match, &count)); |
| 3490 cache_->EndEnumeration(&iter); | 3490 cache_->EndEnumeration(&iter); |
| 3491 | 3491 |
| 3492 EXPECT_EQ(key_pool.size(), count); | 3492 EXPECT_EQ(key_pool.size(), count); |
| 3493 EXPECT_TRUE(keys_to_match.empty()); | 3493 EXPECT_TRUE(keys_to_match.empty()); |
| 3494 } | 3494 } |
| 3495 | 3495 |
| 3496 #endif // defined(OS_POSIX) | 3496 #endif // defined(OS_POSIX) |
| OLD | NEW |