| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 void FileWriterSync::write(Blob* data, ExceptionState& es) | 45 void FileWriterSync::write(Blob* data, ExceptionState& es) |
| 46 { | 46 { |
| 47 ASSERT(writer()); | 47 ASSERT(writer()); |
| 48 ASSERT(m_complete); | 48 ASSERT(m_complete); |
| 49 if (!data) { | 49 if (!data) { |
| 50 es.throwDOMException(TypeMismatchError, ExceptionMessages::failedToExecu
te("write", "FileReaderSync", FileError::typeMismatchErrorMessage)); | 50 es.throwDOMException(TypeMismatchError, ExceptionMessages::failedToExecu
te("write", "FileReaderSync", FileError::typeMismatchErrorMessage)); |
| 51 return; | 51 return; |
| 52 } | 52 } |
| 53 | 53 |
| 54 prepareForWrite(); | 54 prepareForWrite(); |
| 55 writer()->write(position(), WebKit::WebURL(data->url())); | 55 writer()->write(position(), data->uuid()); |
| 56 ASSERT(m_complete); | 56 ASSERT(m_complete); |
| 57 if (m_error) { | 57 if (m_error) { |
| 58 FileError::throwDOMException(es, m_error); | 58 FileError::throwDOMException(es, m_error); |
| 59 return; | 59 return; |
| 60 } | 60 } |
| 61 setPosition(position() + data->size()); | 61 setPosition(position() + data->size()); |
| 62 if (position() > length()) | 62 if (position() > length()) |
| 63 setLength(position()); | 63 setLength(position()); |
| 64 } | 64 } |
| 65 | 65 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 m_complete = false; | 137 m_complete = false; |
| 138 #endif | 138 #endif |
| 139 } | 139 } |
| 140 | 140 |
| 141 FileWriterSync::~FileWriterSync() | 141 FileWriterSync::~FileWriterSync() |
| 142 { | 142 { |
| 143 } | 143 } |
| 144 | 144 |
| 145 | 145 |
| 146 } // namespace WebCore | 146 } // namespace WebCore |
| OLD | NEW |