| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ |
| 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
| 16 #include "net/base/cache_type.h" | 16 #include "net/base/cache_type.h" |
| 17 #include "net/base/net_export.h" |
| 17 #include "net/base/net_log.h" | 18 #include "net/base/net_log.h" |
| 18 #include "net/disk_cache/disk_cache.h" | 19 #include "net/disk_cache/disk_cache.h" |
| 19 #include "net/disk_cache/simple/simple_entry_format.h" | 20 #include "net/disk_cache/simple/simple_entry_format.h" |
| 20 #include "net/disk_cache/simple/simple_entry_operation.h" | 21 #include "net/disk_cache/simple/simple_entry_operation.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class TaskRunner; | 24 class TaskRunner; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace net { | 27 namespace net { |
| 27 class IOBuffer; | 28 class IOBuffer; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace disk_cache { | 31 namespace disk_cache { |
| 31 | 32 |
| 32 class SimpleBackendImpl; | 33 class SimpleBackendImpl; |
| 33 class SimpleSynchronousEntry; | 34 class SimpleSynchronousEntry; |
| 34 struct SimpleEntryStat; | 35 struct SimpleEntryStat; |
| 35 struct SimpleEntryCreationResults; | 36 struct SimpleEntryCreationResults; |
| 36 | 37 |
| 37 // SimpleEntryImpl is the IO thread interface to an entry in the very simple | 38 // SimpleEntryImpl is the IO thread interface to an entry in the very simple |
| 38 // disk cache. It proxies for the SimpleSynchronousEntry, which performs IO | 39 // disk cache. It proxies for the SimpleSynchronousEntry, which performs IO |
| 39 // on the worker thread. | 40 // on the worker thread. |
| 40 class SimpleEntryImpl : public Entry, public base::RefCounted<SimpleEntryImpl>, | 41 class NET_EXPORT_PRIVATE SimpleEntryImpl : public Entry, |
| 42 public base::RefCounted<SimpleEntryImpl>, |
| 41 public base::SupportsWeakPtr<SimpleEntryImpl> { | 43 public base::SupportsWeakPtr<SimpleEntryImpl> { |
| 42 friend class base::RefCounted<SimpleEntryImpl>; | 44 friend class base::RefCounted<SimpleEntryImpl>; |
| 43 public: | 45 public: |
| 44 enum OperationsMode { | 46 enum OperationsMode { |
| 45 NON_OPTIMISTIC_OPERATIONS, | 47 NON_OPTIMISTIC_OPERATIONS, |
| 46 OPTIMISTIC_OPERATIONS, | 48 OPTIMISTIC_OPERATIONS, |
| 47 }; | 49 }; |
| 48 | 50 |
| 49 SimpleEntryImpl(net::CacheType cache_type, | 51 SimpleEntryImpl(net::CacheType cache_type, |
| 50 const base::FilePath& path, | 52 const base::FilePath& path, |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 std::queue<SimpleEntryOperation> pending_operations_; | 298 std::queue<SimpleEntryOperation> pending_operations_; |
| 297 | 299 |
| 298 net::BoundNetLog net_log_; | 300 net::BoundNetLog net_log_; |
| 299 | 301 |
| 300 scoped_ptr<SimpleEntryOperation> executing_operation_; | 302 scoped_ptr<SimpleEntryOperation> executing_operation_; |
| 301 }; | 303 }; |
| 302 | 304 |
| 303 } // namespace disk_cache | 305 } // namespace disk_cache |
| 304 | 306 |
| 305 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ | 307 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ |
| OLD | NEW |