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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
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 DOMFileSystemBase_h | 31 #ifndef DOMFileSystemBase_h |
32 #define DOMFileSystemBase_h | 32 #define DOMFileSystemBase_h |
33 | 33 |
| 34 #include "core/fileapi/FileError.h" |
34 #include "modules/ModulesExport.h" | 35 #include "modules/ModulesExport.h" |
35 #include "modules/filesystem/FileSystemFlags.h" | 36 #include "modules/filesystem/FileSystemFlags.h" |
36 #include "platform/FileSystemType.h" | 37 #include "platform/FileSystemType.h" |
37 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
38 #include "platform/weborigin/KURL.h" | 39 #include "platform/weborigin/KURL.h" |
39 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 class WebFileSystem; | 43 class WebFileSystem; |
43 } | 44 } |
44 | 45 |
45 namespace blink { | 46 namespace blink { |
46 | 47 |
47 class DirectoryReaderBase; | 48 class DirectoryReaderBase; |
48 class EntriesCallback; | 49 class EntriesCallback; |
49 class EntryBase; | 50 class EntryBase; |
50 class EntryCallback; | 51 class EntryCallback; |
51 class ErrorCallback; | 52 class ErrorCallback; |
52 class File; | 53 class File; |
53 class FileError; | |
54 class FileMetadata; | 54 class FileMetadata; |
55 class MetadataCallback; | 55 class MetadataCallback; |
56 class ExecutionContext; | 56 class ExecutionContext; |
57 class SecurityOrigin; | 57 class SecurityOrigin; |
58 class VoidCallback; | 58 class VoidCallback; |
59 | 59 |
60 // A common base class for DOMFileSystem and DOMFileSystemSync. | 60 // A common base class for DOMFileSystem and DOMFileSystemSync. |
61 class MODULES_EXPORT DOMFileSystemBase : public GarbageCollectedFinalized<DOMFil
eSystemBase> { | 61 class MODULES_EXPORT DOMFileSystemBase : public GarbageCollectedFinalized<DOMFil
eSystemBase> { |
62 public: | 62 public: |
63 enum SynchronousType { | 63 enum SynchronousType { |
(...skipping 10 matching lines...) Expand all Loading... |
74 | 74 |
75 virtual ~DOMFileSystemBase(); | 75 virtual ~DOMFileSystemBase(); |
76 | 76 |
77 // These are called when a new callback is created and resolved in | 77 // These are called when a new callback is created and resolved in |
78 // FileSystem API, so that subclasses can track the number of pending | 78 // FileSystem API, so that subclasses can track the number of pending |
79 // callbacks if necessary. | 79 // callbacks if necessary. |
80 virtual void addPendingCallbacks() { } | 80 virtual void addPendingCallbacks() { } |
81 virtual void removePendingCallbacks() { } | 81 virtual void removePendingCallbacks() { } |
82 | 82 |
83 // Overridden by subclasses to handle sync vs async error-handling. | 83 // Overridden by subclasses to handle sync vs async error-handling. |
84 virtual void reportError(ErrorCallback*, FileError*) = 0; | 84 virtual void reportError(ErrorCallback*, FileError::ErrorCode) = 0; |
85 | 85 |
86 const String& name() const { return m_name; } | 86 const String& name() const { return m_name; } |
87 FileSystemType type() const { return m_type; } | 87 FileSystemType type() const { return m_type; } |
88 KURL rootURL() const { return m_filesystemRootURL; } | 88 KURL rootURL() const { return m_filesystemRootURL; } |
89 WebFileSystem* fileSystem() const; | 89 WebFileSystem* fileSystem() const; |
90 SecurityOrigin* getSecurityOrigin() const; | 90 SecurityOrigin* getSecurityOrigin() const; |
91 | 91 |
92 // The clonable flag is used in the structured clone algorithm to test | 92 // The clonable flag is used in the structured clone algorithm to test |
93 // whether the FileSystem API object is permitted to be cloned. It defaults | 93 // whether the FileSystem API object is permitted to be cloned. It defaults |
94 // to false, and must be explicitly set by internal code permit cloning. | 94 // to false, and must be explicitly set by internal code permit cloning. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 FileSystemType m_type; | 130 FileSystemType m_type; |
131 KURL m_filesystemRootURL; | 131 KURL m_filesystemRootURL; |
132 bool m_clonable; | 132 bool m_clonable; |
133 }; | 133 }; |
134 | 134 |
135 inline bool operator==(const DOMFileSystemBase& a, const DOMFileSystemBase& b) {
return a.name() == b.name() && a.type() == b.type() && a.rootURL() == b.rootURL
(); } | 135 inline bool operator==(const DOMFileSystemBase& a, const DOMFileSystemBase& b) {
return a.name() == b.name() && a.type() == b.type() && a.rootURL() == b.rootURL
(); } |
136 | 136 |
137 } // namespace blink | 137 } // namespace blink |
138 | 138 |
139 #endif // DOMFileSystemBase_h | 139 #endif // DOMFileSystemBase_h |
OLD | NEW |