| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 namespace { | 178 namespace { |
| 179 | 179 |
| 180 class ReceiveFileWriterCallback : public FileWriterBaseCallback { | 180 class ReceiveFileWriterCallback : public FileWriterBaseCallback { |
| 181 public: | 181 public: |
| 182 static PassOwnPtr<ReceiveFileWriterCallback> create() | 182 static PassOwnPtr<ReceiveFileWriterCallback> create() |
| 183 { | 183 { |
| 184 return adoptPtr(new ReceiveFileWriterCallback()); | 184 return adoptPtr(new ReceiveFileWriterCallback()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 bool handleEvent(FileWriterBase*) | 187 void handleEvent(FileWriterBase*) |
| 188 { | 188 { |
| 189 return true; | |
| 190 } | 189 } |
| 191 | 190 |
| 192 private: | 191 private: |
| 193 ReceiveFileWriterCallback() | 192 ReceiveFileWriterCallback() |
| 194 { | 193 { |
| 195 } | 194 } |
| 196 }; | 195 }; |
| 197 | 196 |
| 198 class LocalErrorCallback : public ErrorCallback { | 197 class LocalErrorCallback : public ErrorCallback { |
| 199 public: | 198 public: |
| 200 static PassOwnPtr<LocalErrorCallback> create(FileError::ErrorCode& errorCode
) | 199 static PassOwnPtr<LocalErrorCallback> create(FileError::ErrorCode& errorCode
) |
| 201 { | 200 { |
| 202 return adoptPtr(new LocalErrorCallback(errorCode)); | 201 return adoptPtr(new LocalErrorCallback(errorCode)); |
| 203 } | 202 } |
| 204 | 203 |
| 205 bool handleEvent(FileError* error) | 204 void handleEvent(FileError* error) |
| 206 { | 205 { |
| 207 ASSERT(error->code() != FileError::OK); | 206 ASSERT(error->code() != FileError::OK); |
| 208 m_errorCode = error->code(); | 207 m_errorCode = error->code(); |
| 209 return true; | |
| 210 } | 208 } |
| 211 | 209 |
| 212 private: | 210 private: |
| 213 explicit LocalErrorCallback(FileError::ErrorCode& errorCode) | 211 explicit LocalErrorCallback(FileError::ErrorCode& errorCode) |
| 214 : m_errorCode(errorCode) | 212 : m_errorCode(errorCode) |
| 215 { | 213 { |
| 216 } | 214 } |
| 217 | 215 |
| 218 FileError::ErrorCode& m_errorCode; | 216 FileError::ErrorCode& m_errorCode; |
| 219 }; | 217 }; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 234 | 232 |
| 235 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter.ge
t(), callbacks.release()); | 233 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter.ge
t(), callbacks.release()); |
| 236 if (errorCode != FileError::OK) { | 234 if (errorCode != FileError::OK) { |
| 237 FileError::throwDOMException(exceptionState, errorCode); | 235 FileError::throwDOMException(exceptionState, errorCode); |
| 238 return 0; | 236 return 0; |
| 239 } | 237 } |
| 240 return fileWriter.release(); | 238 return fileWriter.release(); |
| 241 } | 239 } |
| 242 | 240 |
| 243 } | 241 } |
| OLD | NEW |