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

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

Issue 103533012: Disk Cache: Use the old WorkerPool for Async IO on iOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 6 years, 11 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) 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 // 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 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 FileIOCallback* callback, bool* completed); 63 FileIOCallback* callback, bool* completed);
64 64
65 // Sets the file's length. The file is truncated or extended with zeros to 65 // Sets the file's length. The file is truncated or extended with zeros to
66 // the new length. 66 // the new length.
67 bool SetLength(size_t length); 67 bool SetLength(size_t length);
68 size_t GetLength(); 68 size_t GetLength();
69 69
70 // Blocks until |num_pending_io| IO operations complete. 70 // Blocks until |num_pending_io| IO operations complete.
71 static void WaitForPendingIO(int* num_pending_io); 71 static void WaitForPendingIO(int* num_pending_io);
72 72
73 // Drops current pending operations without waiting for them to complete.
74 static void DropPendingIO();
75
73 protected: 76 protected:
74 virtual ~File(); 77 virtual ~File();
75 78
76 private: 79 private:
77 // Performs the actual asynchronous write. If notify is set and there is no 80 // Performs the actual asynchronous write. If notify is set and there is no
78 // callback, the call will be re-synchronized. 81 // callback, the call will be re-synchronized.
79 bool AsyncWrite(const void* buffer, size_t buffer_len, size_t offset, 82 bool AsyncWrite(const void* buffer, size_t buffer_len, size_t offset,
80 FileIOCallback* callback, bool* completed); 83 FileIOCallback* callback, bool* completed);
81 84
82 // Infrastructure for async IO. 85 // Infrastructure for async IO.
83 int DoRead(void* buffer, size_t buffer_len, size_t offset); 86 int DoRead(void* buffer, size_t buffer_len, size_t offset);
84 int DoWrite(const void* buffer, size_t buffer_len, size_t offset); 87 int DoWrite(const void* buffer, size_t buffer_len, size_t offset);
85 void OnOperationComplete(FileIOCallback* callback, int result); 88 void OnOperationComplete(FileIOCallback* callback, int result);
86 89
87 bool init_; 90 bool init_;
88 bool mixed_; 91 bool mixed_;
89 base::PlatformFile platform_file_; // Regular, asynchronous IO handle. 92 base::PlatformFile platform_file_; // Regular, asynchronous IO handle.
90 base::PlatformFile sync_platform_file_; // Synchronous IO handle. 93 base::PlatformFile sync_platform_file_; // Synchronous IO handle.
91 94
92 DISALLOW_COPY_AND_ASSIGN(File); 95 DISALLOW_COPY_AND_ASSIGN(File);
93 }; 96 };
94 97
95 } // namespace disk_cache 98 } // namespace disk_cache
96 99
97 #endif // NET_DISK_CACHE_FILE_H_ 100 #endif // NET_DISK_CACHE_FILE_H_
OLDNEW
« no previous file with comments | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/file_ios.cc » ('j') | net/net.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698