OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef AsyncFileSystemCallbacks_h | 31 #ifndef AsyncFileSystemCallbacks_h |
32 #define AsyncFileSystemCallbacks_h | 32 #define AsyncFileSystemCallbacks_h |
33 | 33 |
34 #if ENABLE(FILE_SYSTEM) | 34 #if ENABLE(FILE_SYSTEM) |
35 | 35 |
36 #include "AsyncFileSystem.h" | 36 #include "AsyncFileSystem.h" |
37 #include "AsyncFileWriter.h" | 37 #include "AsyncFileWriter.h" |
| 38 #include "BlobData.h" |
38 #include "FileMetadata.h" | 39 #include "FileMetadata.h" |
39 #include <wtf/text/WTFString.h> | 40 #include <wtf/text/WTFString.h> |
40 | 41 |
41 namespace WebCore { | 42 namespace WebCore { |
42 | 43 |
| 44 class BlobDataHandle; |
| 45 |
43 class AsyncFileSystemCallbacks { | 46 class AsyncFileSystemCallbacks { |
44 WTF_MAKE_NONCOPYABLE(AsyncFileSystemCallbacks); | 47 WTF_MAKE_NONCOPYABLE(AsyncFileSystemCallbacks); |
45 public: | 48 public: |
46 AsyncFileSystemCallbacks() { } | 49 AsyncFileSystemCallbacks() { } |
47 | 50 |
48 // Called when a requested operation is completed successfully. | 51 // Called when a requested operation is completed successfully. |
49 virtual void didSucceed() { ASSERT_NOT_REACHED(); } | 52 virtual void didSucceed() { ASSERT_NOT_REACHED(); } |
50 | 53 |
51 // Called when a requested file system is opened. | 54 // Called when a requested file system is opened. |
52 virtual void didOpenFileSystem(const String& name, const KURL& rootURL, Pass
OwnPtr<AsyncFileSystem>) { ASSERT_NOT_REACHED(); } | 55 virtual void didOpenFileSystem(const String& name, const KURL& rootURL, Pass
OwnPtr<AsyncFileSystem>) { ASSERT_NOT_REACHED(); } |
53 | 56 |
54 // Called when a file metadata is read successfully. | 57 // Called when a file metadata is read successfully. |
55 virtual void didReadMetadata(const FileMetadata&) { ASSERT_NOT_REACHED(); } | 58 virtual void didReadMetadata(const FileMetadata&) { ASSERT_NOT_REACHED(); } |
56 | 59 |
| 60 // Called when a snapshot file is created successfully. |
| 61 virtual void didCreateSnapshotFile(const FileMetadata&, PassRefPtr<BlobDataH
andle> snapshot) { ASSERT_NOT_REACHED(); } |
| 62 |
57 // Called when a directory entry is read. | 63 // Called when a directory entry is read. |
58 virtual void didReadDirectoryEntry(const String& name, bool isDirectory) { A
SSERT_NOT_REACHED(); } | 64 virtual void didReadDirectoryEntry(const String& name, bool isDirectory) { A
SSERT_NOT_REACHED(); } |
59 | 65 |
60 // Called after a chunk of directory entries have been read (i.e. indicates
it's good time to call back to the application). If hasMore is true there can be
more chunks. | 66 // Called after a chunk of directory entries have been read (i.e. indicates
it's good time to call back to the application). If hasMore is true there can be
more chunks. |
61 virtual void didReadDirectoryEntries(bool hasMore) { ASSERT_NOT_REACHED(); } | 67 virtual void didReadDirectoryEntries(bool hasMore) { ASSERT_NOT_REACHED(); } |
62 | 68 |
63 // Called when an AsyncFileWrter has been created successfully. | 69 // Called when an AsyncFileWrter has been created successfully. |
64 virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long leng
th) { ASSERT_NOT_REACHED(); } | 70 virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long leng
th) { ASSERT_NOT_REACHED(); } |
65 | 71 |
66 // Called when there was an error. | 72 // Called when there was an error. |
67 virtual void didFail(int code) = 0; | 73 virtual void didFail(int code) = 0; |
68 | 74 |
69 virtual ~AsyncFileSystemCallbacks() { } | 75 virtual ~AsyncFileSystemCallbacks() { } |
70 }; | 76 }; |
71 | 77 |
72 } // namespace | 78 } // namespace |
73 | 79 |
74 #endif // ENABLE(FILE_SYSTEM) | 80 #endif // ENABLE(FILE_SYSTEM) |
75 | 81 |
76 #endif // AsyncFileSystemCallbacks_h | 82 #endif // AsyncFileSystemCallbacks_h |
OLD | NEW |