Index: pdf/url_loader_wrapper.h |
diff --git a/pdf/url_loader_wrapper.h b/pdf/url_loader_wrapper.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e0f824a0dbc1906d9757caf3c71d98111f6bb65a |
--- /dev/null |
+++ b/pdf/url_loader_wrapper.h |
@@ -0,0 +1,44 @@ |
+// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef PDF_URL_LOADER_WRAPPER_H_ |
+#define PDF_URL_LOADER_WRAPPER_H_ |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "ppapi/cpp/completion_callback.h" |
+ |
+namespace chrome_pdf { |
+ |
+class URLLoaderWrapper { |
+ public: |
+ virtual ~URLLoaderWrapper() {} |
Lei Zhang
2016/10/21 09:33:10
nit: blank line after.
snake
2016/10/21 15:13:16
Done.
|
+ virtual int GetContentLength() const = 0; |
Lei Zhang
2016/10/21 09:33:10
Please document virtual methods. e.g. Does this re
snake
2016/10/21 15:13:16
Done.
|
+ virtual bool IsAcceptRangesBytes() const = 0; |
+ virtual bool IsContentEncoded() const = 0; |
+ virtual std::string GetContentType() const = 0; |
+ virtual std::string GetContentDisposition() const = 0; |
+ virtual int GetStatusCode() const = 0; |
+ virtual bool IsMultipart() const = 0; |
+ virtual bool GetByteRange(int* start, int* end) const = 0; |
Lei Zhang
2016/10/21 09:33:10
If this returns false, does |start| and |end| get
snake
2016/10/21 15:13:16
Done.
|
+ |
+ virtual void Close() = 0; |
+ virtual void OpenRange(const std::string& url, |
+ const std::string& referrer_url, |
+ uint32_t position, |
+ uint32_t size, |
+ const pp::CompletionCallback& cc) = 0; |
+ |
+ virtual void ReadResponseBody(char* buffer, |
+ int buffer_size, |
+ const pp::CompletionCallback& cc) = 0; |
+ virtual bool GetDownloadProgress( |
+ int64_t* bytes_received, |
+ int64_t* total_bytes_to_be_received) const = 0; |
+}; |
+ |
+} // namespace chrome_pdf |
+ |
+#endif // PDF_URL_LOADER_WRAPPER_H_ |