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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class FileSystemCallbacksBase : public AsyncFileSystemCallbacks { | 56 class FileSystemCallbacksBase : public AsyncFileSystemCallbacks { |
57 public: | 57 public: |
58 virtual ~FileSystemCallbacksBase(); | 58 virtual ~FileSystemCallbacksBase(); |
59 | 59 |
60 // For ErrorCallback. | 60 // For ErrorCallback. |
61 virtual void didFail(int code) OVERRIDE FINAL; | 61 virtual void didFail(int code) OVERRIDE FINAL; |
62 | 62 |
63 // Other callback methods are implemented by each subclass. | 63 // Other callback methods are implemented by each subclass. |
64 | 64 |
65 protected: | 65 protected: |
66 FileSystemCallbacksBase(PassOwnPtr<ErrorCallback>, DOMFileSystemBase*); | 66 FileSystemCallbacksBase(PassOwnPtr<ErrorCallback>, PassRefPtrWillBeRawPtr<DO
MFileSystemBase>); |
67 OwnPtr<ErrorCallback> m_errorCallback; | 67 OwnPtr<ErrorCallback> m_errorCallback; |
68 DOMFileSystemBase* m_fileSystem; | 68 RefPtrWillBePersistent<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>, PassRefPtrWillBeRawPtr<DOMFileSystemBase>, const St
ring& expectedPath, 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: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 virtual void didResolveURL(const String& name, const KURL& rootURL, FileSyst
emType, const String& filePath, bool isDirectry) OVERRIDE; | 114 virtual void didResolveURL(const String& name, const KURL& rootURL, FileSyst
emType, const String& filePath, bool isDirectry) OVERRIDE; |
115 | 115 |
116 private: | 116 private: |
117 ResolveURICallbacks(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, Ex
ecutionContext*); | 117 ResolveURICallbacks(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, Ex
ecutionContext*); |
118 OwnPtr<EntryCallback> m_successCallback; | 118 OwnPtr<EntryCallback> m_successCallback; |
119 RefPtr<ExecutionContext> m_executionContext; | 119 RefPtr<ExecutionContext> m_executionContext; |
120 }; | 120 }; |
121 | 121 |
122 class MetadataCallbacks FINAL : public FileSystemCallbacksBase { | 122 class MetadataCallbacks FINAL : public FileSystemCallbacksBase { |
123 public: | 123 public: |
124 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<MetadataCallba
ck>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*); | 124 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<MetadataCallba
ck>, PassOwnPtr<ErrorCallback>, PassRefPtrWillBeRawPtr<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>, P
assRefPtrWillBeRawPtr<DOMFileSystemBase>); |
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(PassRefPtrWillBeRawPtr<Fi
leWriterBase>, 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(PassRefPtrWillBeRawPtr<FileWriterBase>, PassOwnPtr<F
ileWriterBaseCallback>, PassOwnPtr<ErrorCallback>); | 138 FileWriterBaseCallbacks(PassRefPtrWillBeRawPtr<FileWriterBase>, PassOwnPtr<F
ileWriterBaseCallback>, PassOwnPtr<ErrorCallback>); |
139 RefPtrWillBePersistent<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>, PassRefPtrWillBeRawPtr<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>, PassRefPt
rWillBeRawPtr<DOMFileSystemBase>); |
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 |