| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 ReadByClient | 62 ReadByClient |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 // If client is given, do the loading asynchronously. Otherwise, load synchr
onously. | 65 // If client is given, do the loading asynchronously. Otherwise, load synchr
onously. |
| 66 static PassOwnPtr<FileReaderLoader> create(ReadType readType, FileReaderLoad
erClient* client) | 66 static PassOwnPtr<FileReaderLoader> create(ReadType readType, FileReaderLoad
erClient* client) |
| 67 { | 67 { |
| 68 return adoptPtr(new FileReaderLoader(readType, client)); | 68 return adoptPtr(new FileReaderLoader(readType, client)); |
| 69 } | 69 } |
| 70 | 70 |
| 71 FileReaderLoader(ReadType, FileReaderLoaderClient*); | 71 FileReaderLoader(ReadType, FileReaderLoaderClient*); |
| 72 virtual ~FileReaderLoader(); | 72 ~FileReaderLoader() override; |
| 73 | 73 |
| 74 void start(ExecutionContext*, PassRefPtr<BlobDataHandle>); | 74 void start(ExecutionContext*, PassRefPtr<BlobDataHandle>); |
| 75 void start(ExecutionContext*, const Stream&, unsigned readSize); | 75 void start(ExecutionContext*, const Stream&, unsigned readSize); |
| 76 void cancel(); | 76 void cancel(); |
| 77 | 77 |
| 78 // ThreadableLoaderClient | 78 // ThreadableLoaderClient |
| 79 virtual void didReceiveResponse(unsigned long, const ResourceResponse&, Pass
OwnPtr<WebDataConsumerHandle>) override; | 79 void didReceiveResponse(unsigned long, const ResourceResponse&, PassOwnPtr<W
ebDataConsumerHandle>) override; |
| 80 virtual void didReceiveData(const char*, unsigned) override; | 80 void didReceiveData(const char*, unsigned) override; |
| 81 virtual void didFinishLoading(unsigned long, double) override; | 81 void didFinishLoading(unsigned long, double) override; |
| 82 virtual void didFail(const ResourceError&) override; | 82 void didFail(const ResourceError&) override; |
| 83 | 83 |
| 84 String stringResult(); | 84 String stringResult(); |
| 85 PassRefPtr<DOMArrayBuffer> arrayBufferResult() const; | 85 PassRefPtr<DOMArrayBuffer> arrayBufferResult() const; |
| 86 | 86 |
| 87 // Returns the total bytes received. Bytes ignored by m_rawData won't be | 87 // Returns the total bytes received. Bytes ignored by m_rawData won't be |
| 88 // counted. | 88 // counted. |
| 89 // | 89 // |
| 90 // This value doesn't grow more than numeric_limits<unsigned> when | 90 // This value doesn't grow more than numeric_limits<unsigned> when |
| 91 // m_readType is not set to ReadByClient. | 91 // m_readType is not set to ReadByClient. |
| 92 long long bytesLoaded() const { return m_bytesLoaded; } | 92 long long bytesLoaded() const { return m_bytesLoaded; } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 bool m_hasRange; | 144 bool m_hasRange; |
| 145 unsigned m_rangeStart; | 145 unsigned m_rangeStart; |
| 146 unsigned m_rangeEnd; | 146 unsigned m_rangeEnd; |
| 147 | 147 |
| 148 FileError::ErrorCode m_errorCode; | 148 FileError::ErrorCode m_errorCode; |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } // namespace blink | 151 } // namespace blink |
| 152 | 152 |
| 153 #endif // FileReaderLoader_h | 153 #endif // FileReaderLoader_h |
| OLD | NEW |