Changeset 68242 in webkit
- Timestamp:
- Sep 24, 2010 1:15:20 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r68241 r68242 1 2010-09-24 Eric Uhrhane <ericu@chromium.org> 2 3 Reviewed by David Levin. 4 5 Remove unnecessary parameter from AsyncFileWriterClient::didTruncate 6 https://bugs.webkit.org/show_bug.cgi?id=46390 7 8 * fileapi/AsyncFileWriterClient.h: 9 10 Added state to FileWriter to replace the parameter. 11 * fileapi/FileWriter.h: 12 * fileapi/FileWriter.cpp: 13 (WebCore::FileWriter::truncate): 14 (WebCore::FileWriter::didTruncate): 15 1 16 2010-09-24 Sheriff Bot <webkit.review.bot@gmail.com> 2 17 -
trunk/WebCore/fileapi/AsyncFileWriterClient.h
r68180 r68242 43 43 44 44 virtual void didWrite(long long bytes, bool complete) = 0; 45 virtual void didTruncate( long long position) = 0;45 virtual void didTruncate() = 0; 46 46 virtual void didFail(ExceptionCode) = 0; 47 47 }; -
trunk/WebCore/fileapi/FileWriter.cpp
r67614 r68242 49 49 , m_bytesWritten(0) 50 50 , m_bytesToWrite(0) 51 , m_truncateLength(-1) 51 52 { 52 53 } … … 123 124 { 124 125 ASSERT(m_writer); 125 if (m_readyState == WRITING || position >= m_length) {126 if (m_readyState == WRITING || position < 0) { 126 127 ec = INVALID_STATE_ERR; 127 128 m_error = FileError::create(ec); … … 131 132 m_bytesWritten = 0; 132 133 m_bytesToWrite = 0; 134 m_truncateLength = position; 133 135 fireEvent(eventNames().writestartEvent); 134 136 m_writer->truncate(position); … … 168 170 } 169 171 170 void FileWriter::didTruncate(long long length) 171 { 172 ASSERT(length > 0); 173 ASSERT(length >= 0); 174 ASSERT(length < m_length); 175 m_length = length; 172 void FileWriter::didTruncate() 173 { 174 ASSERT(m_truncateLength >= 0); 175 m_length = m_truncateLength; 176 176 if (m_position > m_length) 177 177 m_position = m_length; 178 178 m_readyState = DONE; 179 m_truncateLength = -1; 179 180 fireEvent(eventNames().writeEvent); 180 181 fireEvent(eventNames().writeendEvent); -
trunk/WebCore/fileapi/FileWriter.h
r68180 r68242 77 77 // AsyncFileWriterClient 78 78 void didWrite(long long bytes, bool complete); 79 void didTruncate( long long length);79 void didTruncate(); 80 80 void didFail(ExceptionCode ec); 81 81 … … 122 122 long long m_bytesWritten; 123 123 long long m_bytesToWrite; 124 long long m_truncateLength; 124 125 }; 125 126 -
trunk/WebKit/chromium/ChangeLog
r68240 r68242 1 2010-09-24 Eric Uhrhane <ericu@chromium.org> 2 3 Reviewed by David Levin. 4 5 Remove unnecessary parameter from AsyncFileWriterClient::didTruncate 6 https://bugs.webkit.org/show_bug.cgi?id=46390 7 8 * public/WebFileWriterClient.h: 9 * src/AsyncFileWriterChromium.cpp: 10 * src/AsyncFileWriterChromium.h: 11 1 12 2010-09-24 Chris Guillory <chris.guillory@google.com> 2 13 -
trunk/WebKit/chromium/public/WebFileWriterClient.h
r67446 r68242 44 44 45 45 // Called once when the truncate completes successfully. 46 virtual void didTruncate( long long length) = 0;46 virtual void didTruncate() = 0; 47 47 48 48 // Called if the write or truncate fails, or if it is cancelled before the write or truncate completes. Completion of an operation will be signalled exactly once, either by didFail, didTruncate, or didWrite(..., true). -
trunk/WebKit/chromium/src/AsyncFileWriterChromium.cpp
r68180 r68242 79 79 } 80 80 81 void AsyncFileWriterChromium::didTruncate( long long length)81 void AsyncFileWriterChromium::didTruncate() 82 82 { 83 m_client->didTruncate( length);83 m_client->didTruncate(); 84 84 } 85 85 -
trunk/WebKit/chromium/src/AsyncFileWriterChromium.h
r68180 r68242 62 62 // WebFileWriterClient 63 63 virtual void didWrite(long long bytes, bool complete); 64 virtual void didTruncate( long long length);64 virtual void didTruncate(); 65 65 virtual void didFail(WebKit::WebFileError); 66 66
Note: See TracChangeset
for help on using the changeset viewer.