| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 void FileReaderLoader::cleanup() | 157 void FileReaderLoader::cleanup() |
| 158 { | 158 { |
| 159 m_loader = 0; | 159 m_loader = 0; |
| 160 | 160 |
| 161 // If we get any error, we do not need to keep a buffer around. | 161 // If we get any error, we do not need to keep a buffer around. |
| 162 if (m_errorCode) { | 162 if (m_errorCode) { |
| 163 m_rawData.clear(); | 163 m_rawData.clear(); |
| 164 m_stringResult = ""; | 164 m_stringResult = ""; |
| 165 m_isRawDataConverted = true; | 165 m_isRawDataConverted = true; |
| 166 m_decoder = 0; | 166 m_decoder.clear(); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 void FileReaderLoader::didReceiveResponse(unsigned long, const ResourceResponse&
response) | 170 void FileReaderLoader::didReceiveResponse(unsigned long, const ResourceResponse&
response) |
| 171 { | 171 { |
| 172 if (response.httpStatusCode() != 200) { | 172 if (response.httpStatusCode() != 200) { |
| 173 failed(httpStatusCodeToErrorCode(response.httpStatusCode())); | 173 failed(httpStatusCodeToErrorCode(response.httpStatusCode())); |
| 174 return; | 174 return; |
| 175 } | 175 } |
| 176 | 176 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 m_stringResult = builder.toString(); | 394 m_stringResult = builder.toString(); |
| 395 } | 395 } |
| 396 | 396 |
| 397 void FileReaderLoader::setEncoding(const String& encoding) | 397 void FileReaderLoader::setEncoding(const String& encoding) |
| 398 { | 398 { |
| 399 if (!encoding.isEmpty()) | 399 if (!encoding.isEmpty()) |
| 400 m_encoding = WTF::TextEncoding(encoding); | 400 m_encoding = WTF::TextEncoding(encoding); |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace WebCore | 403 } // namespace WebCore |
| OLD | NEW |