OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PDF_URL_LOADER_WRAPPER_H_ |
| 6 #define PDF_URL_LOADER_WRAPPER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "ppapi/cpp/completion_callback.h" |
| 12 |
| 13 namespace chrome_pdf { |
| 14 |
| 15 class URLLoaderWrapper { |
| 16 public: |
| 17 virtual ~URLLoaderWrapper() {} |
| 18 virtual int GetContentLength() const = 0; |
| 19 virtual bool IsAcceptRangesBytes() const = 0; |
| 20 virtual bool IsContentEncoded() const = 0; |
| 21 virtual std::string GetContentType() const = 0; |
| 22 virtual std::string GetContentDisposition() const = 0; |
| 23 virtual int GetStatusCode() const = 0; |
| 24 virtual bool IsMultipart() const = 0; |
| 25 virtual bool GetByteRange(int* start, int* end) const = 0; |
| 26 |
| 27 virtual void Close() = 0; |
| 28 virtual void OpenRange(const std::string& url, |
| 29 const std::string& referrer_url, |
| 30 uint32_t position, |
| 31 uint32_t size, |
| 32 const pp::CompletionCallback& cc) = 0; |
| 33 |
| 34 virtual void ReadResponseBody(char* buffer, |
| 35 int buffer_size, |
| 36 const pp::CompletionCallback& cc) = 0; |
| 37 virtual bool GetDownloadProgress( |
| 38 int64_t* bytes_received, |
| 39 int64_t* total_bytes_to_be_received) const = 0; |
| 40 }; |
| 41 |
| 42 } // namespace chrome_pdf |
| 43 |
| 44 #endif // PDF_URL_LOADER_WRAPPER_H_ |
OLD | NEW |