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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 protected: | 65 protected: |
66 FileSystemCallbacksBase(PassOwnPtr<ErrorCallback>, DOMFileSystemBase*); | 66 FileSystemCallbacksBase(PassOwnPtr<ErrorCallback>, DOMFileSystemBase*); |
67 OwnPtr<ErrorCallback> m_errorCallback; | 67 OwnPtr<ErrorCallback> m_errorCallback; |
68 DOMFileSystemBase* m_fileSystem; | 68 DOMFileSystemBase* m_fileSystem; |
69 }; | 69 }; |
70 | 70 |
71 // Subclasses ---------------------------------------------------------------- | 71 // Subclasses ---------------------------------------------------------------- |
72 | 72 |
73 class EntryCallbacks FINAL : public FileSystemCallbacksBase { | 73 class EntryCallbacks FINAL : public FileSystemCallbacksBase { |
74 public: | 74 public: |
75 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntryCallback>
, PassOwnPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expect
edPath, bool isDirectory); | 75 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntryCallback>
, PassOwnPtr<ErrorCallback>, PassRefPtrWillBeRawPtr<DOMFileSystemBase>, const St
ring& expectedPath, bool isDirectory); |
76 virtual void didSucceed() OVERRIDE; | 76 virtual void didSucceed() OVERRIDE; |
77 | 77 |
78 private: | 78 private: |
79 EntryCallbacks(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, PassRef
Ptr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory); | 79 EntryCallbacks(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, PassRef
PtrWillBeRawPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory
); |
80 OwnPtr<EntryCallback> m_successCallback; | 80 OwnPtr<EntryCallback> m_successCallback; |
81 String m_expectedPath; | 81 String m_expectedPath; |
82 bool m_isDirectory; | 82 bool m_isDirectory; |
83 }; | 83 }; |
84 | 84 |
85 class EntriesCallbacks FINAL : public FileSystemCallbacksBase { | 85 class EntriesCallbacks FINAL : public FileSystemCallbacksBase { |
86 public: | 86 public: |
87 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntriesCallbac
k>, PassOwnPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& ba
sePath); | 87 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntriesCallbac
k>, PassOwnPtr<ErrorCallback>, PassRefPtrWillBeRawPtr<DirectoryReaderBase>, cons
t String& basePath); |
88 virtual void didReadDirectoryEntry(const String& name, bool isDirectory) OVE
RRIDE; | 88 virtual void didReadDirectoryEntry(const String& name, bool isDirectory) OVE
RRIDE; |
89 virtual void didReadDirectoryEntries(bool hasMore) OVERRIDE; | 89 virtual void didReadDirectoryEntries(bool hasMore) OVERRIDE; |
90 | 90 |
91 private: | 91 private: |
92 EntriesCallbacks(PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback>, Pas
sRefPtr<DirectoryReaderBase>, const String& basePath); | 92 EntriesCallbacks(PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback>, Pas
sRefPtrWillBeRawPtr<DirectoryReaderBase>, const String& basePath); |
93 OwnPtr<EntriesCallback> m_successCallback; | 93 OwnPtr<EntriesCallback> m_successCallback; |
94 RefPtr<DirectoryReaderBase> m_directoryReader; | 94 RefPtrWillBePersistent<DirectoryReaderBase> m_directoryReader; |
95 String m_basePath; | 95 String m_basePath; |
96 EntryVector m_entries; | 96 WillBePersistentHeapVector<RefPtrWillBeMember<Entry> > m_entries; |
97 }; | 97 }; |
98 | 98 |
99 class FileSystemCallbacks FINAL : public FileSystemCallbacksBase { | 99 class FileSystemCallbacks FINAL : public FileSystemCallbacksBase { |
100 public: | 100 public: |
101 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<FileSystemCall
back>, PassOwnPtr<ErrorCallback>, ExecutionContext*, FileSystemType); | 101 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<FileSystemCall
back>, PassOwnPtr<ErrorCallback>, ExecutionContext*, FileSystemType); |
102 virtual void didOpenFileSystem(const String& name, const KURL& rootURL) OVER
RIDE; | 102 virtual void didOpenFileSystem(const String& name, const KURL& rootURL) OVER
RIDE; |
103 | 103 |
104 private: | 104 private: |
105 FileSystemCallbacks(PassOwnPtr<FileSystemCallback>, PassOwnPtr<ErrorCallback
>, ExecutionContext*, FileSystemType); | 105 FileSystemCallbacks(PassOwnPtr<FileSystemCallback>, PassOwnPtr<ErrorCallback
>, ExecutionContext*, FileSystemType); |
106 OwnPtr<FileSystemCallback> m_successCallback; | 106 OwnPtr<FileSystemCallback> m_successCallback; |
(...skipping 17 matching lines...) Expand all Loading... |
124 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<MetadataCallba
ck>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*); | 124 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<MetadataCallba
ck>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*); |
125 virtual void didReadMetadata(const FileMetadata&) OVERRIDE; | 125 virtual void didReadMetadata(const FileMetadata&) OVERRIDE; |
126 | 126 |
127 private: | 127 private: |
128 MetadataCallbacks(PassOwnPtr<MetadataCallback>, PassOwnPtr<ErrorCallback>, D
OMFileSystemBase*); | 128 MetadataCallbacks(PassOwnPtr<MetadataCallback>, PassOwnPtr<ErrorCallback>, D
OMFileSystemBase*); |
129 OwnPtr<MetadataCallback> m_successCallback; | 129 OwnPtr<MetadataCallback> m_successCallback; |
130 }; | 130 }; |
131 | 131 |
132 class FileWriterBaseCallbacks FINAL : public FileSystemCallbacksBase { | 132 class FileWriterBaseCallbacks FINAL : public FileSystemCallbacksBase { |
133 public: | 133 public: |
134 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<FileWriterBase
>, PassOwnPtr<FileWriterBaseCallback>, PassOwnPtr<ErrorCallback>); | 134 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtrWillBeRawPtr<Fi
leWriterBase>, PassOwnPtr<FileWriterBaseCallback>, PassOwnPtr<ErrorCallback>); |
135 virtual void didCreateFileWriter(PassOwnPtr<blink::WebFileWriter>, long long
length) OVERRIDE; | 135 virtual void didCreateFileWriter(PassOwnPtr<blink::WebFileWriter>, long long
length) OVERRIDE; |
136 | 136 |
137 private: | 137 private: |
138 FileWriterBaseCallbacks(PassRefPtr<FileWriterBase>, PassOwnPtr<FileWriterBas
eCallback>, PassOwnPtr<ErrorCallback>); | 138 FileWriterBaseCallbacks(PassRefPtrWillBeRawPtr<FileWriterBase>, PassOwnPtr<F
ileWriterBaseCallback>, PassOwnPtr<ErrorCallback>); |
139 RefPtr<FileWriterBase> m_fileWriter; | 139 RefPtrWillBePersistent<FileWriterBase> m_fileWriter; |
140 OwnPtr<FileWriterBaseCallback> m_successCallback; | 140 OwnPtr<FileWriterBaseCallback> m_successCallback; |
141 }; | 141 }; |
142 | 142 |
143 class VoidCallbacks FINAL : public FileSystemCallbacksBase { | 143 class VoidCallbacks FINAL : public FileSystemCallbacksBase { |
144 public: | 144 public: |
145 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<VoidCallback>,
PassOwnPtr<ErrorCallback>, DOMFileSystemBase*); | 145 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<VoidCallback>,
PassOwnPtr<ErrorCallback>, DOMFileSystemBase*); |
146 virtual void didSucceed() OVERRIDE; | 146 virtual void didSucceed() OVERRIDE; |
147 | 147 |
148 private: | 148 private: |
149 VoidCallbacks(PassOwnPtr<VoidCallback>, PassOwnPtr<ErrorCallback>, DOMFileSy
stemBase*); | 149 VoidCallbacks(PassOwnPtr<VoidCallback>, PassOwnPtr<ErrorCallback>, DOMFileSy
stemBase*); |
150 OwnPtr<VoidCallback> m_successCallback; | 150 OwnPtr<VoidCallback> m_successCallback; |
151 }; | 151 }; |
152 | 152 |
153 } // namespace | 153 } // namespace |
154 | 154 |
155 #endif // FileSystemCallbacks_h | 155 #endif // FileSystemCallbacks_h |
OLD | NEW |