| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class DirectoryEntry; | 46 class DirectoryEntry; |
| 47 class DirectoryReaderBase; | 47 class DirectoryReaderBase; |
| 48 class EntriesCallback; | 48 class EntriesCallback; |
| 49 class EntryBase; | 49 class EntryBase; |
| 50 class EntryCallback; | 50 class EntryCallback; |
| 51 class ErrorCallback; | 51 class ErrorCallback; |
| 52 class File; |
| 52 class FileError; | 53 class FileError; |
| 54 struct FileMetadata; |
| 53 class MetadataCallback; | 55 class MetadataCallback; |
| 54 class ExecutionContext; | 56 class ExecutionContext; |
| 55 class SecurityOrigin; | 57 class SecurityOrigin; |
| 56 class VoidCallback; | 58 class VoidCallback; |
| 57 | 59 |
| 58 // A common base class for DOMFileSystem and DOMFileSystemSync. | 60 // A common base class for DOMFileSystem and DOMFileSystemSync. |
| 59 class DOMFileSystemBase : public GarbageCollectedFinalized<DOMFileSystemBase> { | 61 class DOMFileSystemBase : public GarbageCollectedFinalized<DOMFileSystemBase> { |
| 60 public: | 62 public: |
| 61 enum SynchronousType { | 63 enum SynchronousType { |
| 62 Synchronous, | 64 Synchronous, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 bool clonable() const { return m_clonable; } | 96 bool clonable() const { return m_clonable; } |
| 95 | 97 |
| 96 static bool isValidType(FileSystemType); | 98 static bool isValidType(FileSystemType); |
| 97 static bool crackFileSystemURL(const KURL&, FileSystemType&, String& filePat
h); | 99 static bool crackFileSystemURL(const KURL&, FileSystemType&, String& filePat
h); |
| 98 static KURL createFileSystemRootURL(const String& origin, FileSystemType); | 100 static KURL createFileSystemRootURL(const String& origin, FileSystemType); |
| 99 bool supportsToURL() const; | 101 bool supportsToURL() const; |
| 100 KURL createFileSystemURL(const EntryBase*) const; | 102 KURL createFileSystemURL(const EntryBase*) const; |
| 101 KURL createFileSystemURL(const String& fullPath) const; | 103 KURL createFileSystemURL(const String& fullPath) const; |
| 102 static bool pathToAbsolutePath(FileSystemType, const EntryBase*, String path
, String& absolutePath); | 104 static bool pathToAbsolutePath(FileSystemType, const EntryBase*, String path
, String& absolutePath); |
| 103 static bool pathPrefixToFileSystemType(const String& pathPrefix, FileSystemT
ype&); | 105 static bool pathPrefixToFileSystemType(const String& pathPrefix, FileSystemT
ype&); |
| 106 static PassRefPtrWillBeRawPtr<File> createFile(const FileMetadata&, const KU
RL& fileSystemURL, FileSystemType, const String name); |
| 104 | 107 |
| 105 // Actual FileSystem API implementations. All the validity checks on virtual
paths are done at this level. | 108 // Actual FileSystem API implementations. All the validity checks on virtual
paths are done at this level. |
| 106 void getMetadata(const EntryBase*, PassOwnPtrWillBeRawPtr<MetadataCallback>,
PassOwnPtrWillBeRawPtr<ErrorCallback>, SynchronousType = Asynchronous); | 109 void getMetadata(const EntryBase*, PassOwnPtrWillBeRawPtr<MetadataCallback>,
PassOwnPtrWillBeRawPtr<ErrorCallback>, SynchronousType = Asynchronous); |
| 107 void move(const EntryBase* source, EntryBase* parent, const String& name, Pa
ssOwnPtrWillBeRawPtr<EntryCallback>, PassOwnPtrWillBeRawPtr<ErrorCallback>, Sync
hronousType = Asynchronous); | 110 void move(const EntryBase* source, EntryBase* parent, const String& name, Pa
ssOwnPtrWillBeRawPtr<EntryCallback>, PassOwnPtrWillBeRawPtr<ErrorCallback>, Sync
hronousType = Asynchronous); |
| 108 void copy(const EntryBase* source, EntryBase* parent, const String& name, Pa
ssOwnPtrWillBeRawPtr<EntryCallback>, PassOwnPtrWillBeRawPtr<ErrorCallback>, Sync
hronousType = Asynchronous); | 111 void copy(const EntryBase* source, EntryBase* parent, const String& name, Pa
ssOwnPtrWillBeRawPtr<EntryCallback>, PassOwnPtrWillBeRawPtr<ErrorCallback>, Sync
hronousType = Asynchronous); |
| 109 void remove(const EntryBase*, PassOwnPtrWillBeRawPtr<VoidCallback>, PassOwnP
trWillBeRawPtr<ErrorCallback>, SynchronousType = Asynchronous); | 112 void remove(const EntryBase*, PassOwnPtrWillBeRawPtr<VoidCallback>, PassOwnP
trWillBeRawPtr<ErrorCallback>, SynchronousType = Asynchronous); |
| 110 void removeRecursively(const EntryBase*, PassOwnPtrWillBeRawPtr<VoidCallback
>, PassOwnPtrWillBeRawPtr<ErrorCallback>, SynchronousType = Asynchronous); | 113 void removeRecursively(const EntryBase*, PassOwnPtrWillBeRawPtr<VoidCallback
>, PassOwnPtrWillBeRawPtr<ErrorCallback>, SynchronousType = Asynchronous); |
| 111 void getParent(const EntryBase*, PassOwnPtrWillBeRawPtr<EntryCallback>, Pass
OwnPtrWillBeRawPtr<ErrorCallback>); | 114 void getParent(const EntryBase*, PassOwnPtrWillBeRawPtr<EntryCallback>, Pass
OwnPtrWillBeRawPtr<ErrorCallback>); |
| 112 void getFile(const EntryBase*, const String& path, const FileSystemFlags&, P
assOwnPtrWillBeRawPtr<EntryCallback>, PassOwnPtrWillBeRawPtr<ErrorCallback>, Syn
chronousType = Asynchronous); | 115 void getFile(const EntryBase*, const String& path, const FileSystemFlags&, P
assOwnPtrWillBeRawPtr<EntryCallback>, PassOwnPtrWillBeRawPtr<ErrorCallback>, Syn
chronousType = Asynchronous); |
| 113 void getDirectory(const EntryBase*, const String& path, const FileSystemFlag
s&, PassOwnPtrWillBeRawPtr<EntryCallback>, PassOwnPtrWillBeRawPtr<ErrorCallback>
, SynchronousType = Asynchronous); | 116 void getDirectory(const EntryBase*, const String& path, const FileSystemFlag
s&, PassOwnPtrWillBeRawPtr<EntryCallback>, PassOwnPtrWillBeRawPtr<ErrorCallback>
, SynchronousType = Asynchronous); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 125 FileSystemType m_type; | 128 FileSystemType m_type; |
| 126 KURL m_filesystemRootURL; | 129 KURL m_filesystemRootURL; |
| 127 bool m_clonable; | 130 bool m_clonable; |
| 128 }; | 131 }; |
| 129 | 132 |
| 130 inline bool operator==(const DOMFileSystemBase& a, const DOMFileSystemBase& b) {
return a.name() == b.name() && a.type() == b.type() && a.rootURL() == b.rootURL
(); } | 133 inline bool operator==(const DOMFileSystemBase& a, const DOMFileSystemBase& b) {
return a.name() == b.name() && a.type() == b.type() && a.rootURL() == b.rootURL
(); } |
| 131 | 134 |
| 132 } // namespace blink | 135 } // namespace blink |
| 133 | 136 |
| 134 #endif // DOMFileSystemBase_h | 137 #endif // DOMFileSystemBase_h |
| OLD | NEW |