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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 DOMFileSystemSync::DOMFileSystemSync(ExecutionContext* context, const String& na
me, FileSystemType type, const KURL& rootURL) | 58 DOMFileSystemSync::DOMFileSystemSync(ExecutionContext* context, const String& na
me, FileSystemType type, const KURL& rootURL) |
59 : DOMFileSystemBase(context, name, type, rootURL) | 59 : DOMFileSystemBase(context, name, type, rootURL) |
60 , m_rootEntry(DirectoryEntrySync::create(this, DOMFilePath::root)) | 60 , m_rootEntry(DirectoryEntrySync::create(this, DOMFilePath::root)) |
61 { | 61 { |
62 } | 62 } |
63 | 63 |
64 DOMFileSystemSync::~DOMFileSystemSync() | 64 DOMFileSystemSync::~DOMFileSystemSync() |
65 { | 65 { |
66 } | 66 } |
67 | 67 |
68 void DOMFileSystemSync::reportError(ErrorCallback* errorCallback, FileError* fil
eError) | 68 void DOMFileSystemSync::reportError(ErrorCallbackBase* errorCallback, FileError:
:ErrorCode fileError) |
69 { | 69 { |
70 errorCallback->handleEvent(fileError); | 70 errorCallback->invoke(fileError); |
71 } | 71 } |
72 | 72 |
73 DirectoryEntrySync* DOMFileSystemSync::root() | 73 DirectoryEntrySync* DOMFileSystemSync::root() |
74 { | 74 { |
75 return m_rootEntry.get(); | 75 return m_rootEntry.get(); |
76 } | 76 } |
77 | 77 |
78 namespace { | 78 namespace { |
79 | 79 |
80 class CreateFileHelper final : public AsyncFileSystemCallbacks { | 80 class CreateFileHelper final : public AsyncFileSystemCallbacks { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 void handleEvent(FileWriterBase*) override | 174 void handleEvent(FileWriterBase*) override |
175 { | 175 { |
176 } | 176 } |
177 | 177 |
178 private: | 178 private: |
179 ReceiveFileWriterCallback() | 179 ReceiveFileWriterCallback() |
180 { | 180 { |
181 } | 181 } |
182 }; | 182 }; |
183 | 183 |
184 class LocalErrorCallback final : public ErrorCallback { | 184 class LocalErrorCallback final : public ErrorCallbackBase { |
185 public: | 185 public: |
186 static LocalErrorCallback* create(FileError::ErrorCode& errorCode) | 186 static LocalErrorCallback* create(FileError::ErrorCode& errorCode) |
187 { | 187 { |
188 return new LocalErrorCallback(errorCode); | 188 return new LocalErrorCallback(errorCode); |
189 } | 189 } |
190 | 190 |
191 void handleEvent(FileError* error) override | 191 void invoke(FileError::ErrorCode error) override |
192 { | 192 { |
193 ASSERT(error->code() != FileError::OK); | 193 DCHECK_NE(error, FileError::OK); |
194 m_errorCode = error->code(); | 194 m_errorCode = error; |
195 } | 195 } |
196 | 196 |
197 private: | 197 private: |
198 explicit LocalErrorCallback(FileError::ErrorCode& errorCode) | 198 explicit LocalErrorCallback(FileError::ErrorCode& errorCode) |
199 : m_errorCode(errorCode) | 199 : m_errorCode(errorCode) |
200 { | 200 { |
201 } | 201 } |
202 | 202 |
203 FileError::ErrorCode& m_errorCode; | 203 FileError::ErrorCode& m_errorCode; |
204 }; | 204 }; |
(...skipping 20 matching lines...) Expand all Loading... |
225 return fileWriter; | 225 return fileWriter; |
226 } | 226 } |
227 | 227 |
228 DEFINE_TRACE(DOMFileSystemSync) | 228 DEFINE_TRACE(DOMFileSystemSync) |
229 { | 229 { |
230 DOMFileSystemBase::trace(visitor); | 230 DOMFileSystemBase::trace(visitor); |
231 visitor->trace(m_rootEntry); | 231 visitor->trace(m_rootEntry); |
232 } | 232 } |
233 | 233 |
234 } // namespace blink | 234 } // namespace blink |
OLD | NEW |