Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: pdf/url_loader_wrapper.h

Issue 2349753003: Improve linearized pdf load/show time. (Closed)
Patch Set: Fix review issues. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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() {}
Lei Zhang 2016/10/21 09:33:10 nit: blank line after.
snake 2016/10/21 15:13:16 Done.
18 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.
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;
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.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698