Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: net/disk_cache/file.h

Issue 9702059: Disk cache: Remove all non essential synchronization from the cache destructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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 // See net/disk_cache/disk_cache.h for the public interface of the cache. 5 // See net/disk_cache/disk_cache.h for the public interface of the cache.
6 6
7 #ifndef NET_DISK_CACHE_FILE_H_ 7 #ifndef NET_DISK_CACHE_FILE_H_
8 #define NET_DISK_CACHE_FILE_H_ 8 #define NET_DISK_CACHE_FILE_H_
9 #pragma once 9 #pragma once
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 FileIOCallback* callback, bool* completed); 61 FileIOCallback* callback, bool* completed);
62 62
63 // Sets the file's length. The file is truncated or extended with zeros to 63 // Sets the file's length. The file is truncated or extended with zeros to
64 // the new length. 64 // the new length.
65 bool SetLength(size_t length); 65 bool SetLength(size_t length);
66 size_t GetLength(); 66 size_t GetLength();
67 67
68 // Blocks until |num_pending_io| IO operations complete. 68 // Blocks until |num_pending_io| IO operations complete.
69 static void WaitForPendingIO(int* num_pending_io); 69 static void WaitForPendingIO(int* num_pending_io);
70 70
71 // Drops current pending operation without waiting for them to complete.
gavinp 2012/03/20 15:40:08 Nit: // Drops current pending operations without w
72 static void DropPendingIO();
73
71 protected: 74 protected:
72 virtual ~File(); 75 virtual ~File();
73 76
74 // Performs the actual asynchronous write. If notify is set and there is no 77 // Performs the actual asynchronous write. If notify is set and there is no
75 // callback, the call will be re-synchronized. 78 // callback, the call will be re-synchronized.
76 bool AsyncWrite(const void* buffer, size_t buffer_len, size_t offset, 79 bool AsyncWrite(const void* buffer, size_t buffer_len, size_t offset,
77 FileIOCallback* callback, bool* completed); 80 FileIOCallback* callback, bool* completed);
78 81
79 private: 82 private:
80 bool init_; 83 bool init_;
81 bool mixed_; 84 bool mixed_;
82 base::PlatformFile platform_file_; // Regular, asynchronous IO handle. 85 base::PlatformFile platform_file_; // Regular, asynchronous IO handle.
83 base::PlatformFile sync_platform_file_; // Synchronous IO handle. 86 base::PlatformFile sync_platform_file_; // Synchronous IO handle.
84 87
85 DISALLOW_COPY_AND_ASSIGN(File); 88 DISALLOW_COPY_AND_ASSIGN(File);
86 }; 89 };
87 90
88 } // namespace disk_cache 91 } // namespace disk_cache
89 92
90 #endif // NET_DISK_CACHE_FILE_H_ 93 #endif // NET_DISK_CACHE_FILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698