| 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 | 58 |
| 59 public: | 59 public: |
| 60 enum ReadType { | 60 enum ReadType { |
| 61 ReadAsArrayBuffer, | 61 ReadAsArrayBuffer, |
| 62 ReadAsBinaryString, | 62 ReadAsBinaryString, |
| 63 ReadAsText, | 63 ReadAsText, |
| 64 ReadAsDataURL, | 64 ReadAsDataURL, |
| 65 ReadByClient | 65 ReadByClient |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // If client is given, do the loading asynchronously. Otherwise, load synchron
ously. | 68 // If client is given, do the loading asynchronously. Otherwise, load |
| 69 // synchronously. |
| 69 static std::unique_ptr<FileReaderLoader> create( | 70 static std::unique_ptr<FileReaderLoader> create( |
| 70 ReadType readType, | 71 ReadType readType, |
| 71 FileReaderLoaderClient* client) { | 72 FileReaderLoaderClient* client) { |
| 72 return wrapUnique(new FileReaderLoader(readType, client)); | 73 return wrapUnique(new FileReaderLoader(readType, client)); |
| 73 } | 74 } |
| 74 | 75 |
| 75 ~FileReaderLoader() override; | 76 ~FileReaderLoader() override; |
| 76 | 77 |
| 77 void start(ExecutionContext*, PassRefPtr<BlobDataHandle>); | 78 void start(ExecutionContext*, PassRefPtr<BlobDataHandle>); |
| 78 void start(ExecutionContext*, const Stream&, unsigned readSize); | 79 void start(ExecutionContext*, const Stream&, unsigned readSize); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 bool m_hasRange; | 154 bool m_hasRange; |
| 154 unsigned m_rangeStart; | 155 unsigned m_rangeStart; |
| 155 unsigned m_rangeEnd; | 156 unsigned m_rangeEnd; |
| 156 | 157 |
| 157 FileError::ErrorCode m_errorCode; | 158 FileError::ErrorCode m_errorCode; |
| 158 }; | 159 }; |
| 159 | 160 |
| 160 } // namespace blink | 161 } // namespace blink |
| 161 | 162 |
| 162 #endif // FileReaderLoader_h | 163 #endif // FileReaderLoader_h |
| OLD | NEW |