0
Commit Graph

16 Commits

Author SHA1 Message Date
David Benjamin
e4b880eaa9 Add *_piece() methods to http_util's header iterators.
These wrap StringTokenizer which have std::string::const_iterator
thoroughly weaved through them. I suspect we'll need to switch them all
to StringPiece atomically. Start by clearing out as many of the
*_begin() and *_end() calls with a newly-added *_piece(). (This aligns
with StringTokenizer's token_piece() method.)

While I'm here, switch some easy calls that return a std::string copy to
*_piece().

Bug: 820198
Change-Id: I8c17faa40d5ea8cf4c241acc9bf907f1e139f2c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1575164
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654269}
2019-04-26 00:07:51 +00:00
Sebastien Marchand
6d0558fd10 Include base/bind.h in the files that use it.
This also adds it to the whitelist used in
third_party/blink/renderer/DEPS

Gab/Francois, I've used your refactoring script for this, the rule is:
  matches = re.compile(r'(\n *[^/\n][^/\n]*base::Bind(Once|Repeating)?\b[^*])', re.DOTALL).findall(content)

  if not matches:
    return False

  updated_content = refactor_lib.AddInclude(file_path, content, "base/bind.h")

  if updated_content == content:
    return False

  # Write updated file
  refactor_lib.WriteFile(file_path, updated_content)

TBR=fdoray@chromium.org

Change-Id: I7a9a991255a560c6ebedaade47cffe1ac1c7baff
Reviewed-on: https://chromium-review.googlesource.com/c/1437069
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626098}
2019-01-25 16:49:37 +00:00
Artem Strygin
54e088f680 Use base::Timer within pdf plugin instead of chrome_pdf::Timer.
Change-Id: I7bb88a19e280140a2a8126f1199aa4321fdf56ef
Reviewed-on: https://chromium-review.googlesource.com/1102425
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572237}
2018-07-03 15:52:48 +00:00
Lei Zhang
02a3a0f728 Simplify chrome_pdf::URLLoaderWrapper::GetByteRange().
Change it to GetByteRangeStart(), since no caller actually cares about
the end of the byte range.

Fix some nits along the way.

Change-Id: Ia7846923bcf0e5923dd677f85bfe2c5c0ea187c4
Reviewed-on: https://chromium-review.googlesource.com/810005
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523188}
2017-12-11 20:25:48 +00:00
Lei Zhang
f74659eceb Use base::TimeDelta in chrome_pdf::Timer.
Change-Id: Ib087b7ea70bae6bad8c7512cdc7f6c5d84b58661
Reviewed-on: https://chromium-review.googlesource.com/809292
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521873}
2017-12-05 22:48:53 +00:00
Chris Watkins
da5476965f Run clang-tidy modernize-use-equals-{delete,default} on //pdf
See the bugs and cxx post for justification and details:
https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8

This change was done using clang-tidy as described here:
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md

In some cases the the tool leaves behind a string of commas where it
replaced a member initializer list
(https://bugs.llvm.org/show_bug.cgi?id=35051). They were cleaned up with:
  git diff --name-only | \
    xargs sed -E -i 's/(^\s*|\)\s*):[ ,]*= default/\1 = default/'

BUG=778959,778957

Change-Id: I0d5e3f40888d55b57aede103dad6345c1df99f7a
Reviewed-on: https://chromium-review.googlesource.com/790011
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Chris Watkins <watk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520422}
2017-11-30 03:49:24 +00:00
Lei Zhang
64aa552cac Replace base::MakeUnique() in pdf/
Also use base::ASCIIToUTF16() where appropriate instead of

base: :UTF8ToUTF16().
Change-Id: Ia3f86d40bc5f22d1b80dc2fd59fdca8074fd1678
Reviewed-on: https://chromium-review.googlesource.com/706567
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509438}
2017-10-17 18:35:53 +00:00
Artem Strygin
af1b4342b8 Reland of Improve linearized pdf load/show time."
Use received bytes count as the value for progress, not chunks count.

Reason for reland: 
The fix of revert reason has been added.

Bug: 755061

Original change's description:
> Revert "Reland of Improve linearized pdf load/show time."
>
> This reverts commit 9a6d148799.
>
> Reason for revert: https://crbug.com/755061. This appears to be
> causing a serious regression in loading. The loading bar does not
> appear as expected and appears all at once at the end as the screen
> displays. There is 5-6seconds of nothing happening which makes it look
> like the browser has stopped working.
>
>
> Original change's description:
> > Reland of Improve linearized pdf load/show time.
> >
> > XFA forms loading has been fixed.
> > Now for document with single non XFA page, the form load first.
> > This is necessary for correct loading pages, because in XFA document
> > the page count and them contents may be changed after loading form.
> >
> > See
> > https://codereview.chromium.org/2558573002/
> >
> > For test this:
> >  build chromium pdf with XFA support
> >  and open any document from
> >  https://www.idrsolutions.com/jpdfforms/xfa-html5-example-conversions/
> >
> > Original CL:
> >  https://codereview.chromium.org/2455403002/
> >
> > Original description:
> >  Improve linearized pdf load/show time.
> >  Reduce Pdf Plugin's count of reconnects.
> >  Add tests for PDFPlugin DocumentLoader.
> >
> >  DocumentLoader was splitted into separate components, and missing tests was added for them.
> >
> >  The main ideas in this CL are:
> >
> >  1) Do not reset browser initiated connection at start (includes case when we can use range requests), if we request data near current downloading position.
> >  2) Request as much data as we can on each request, and continue loading data using current range request. (like tape rewind)
> >  3) Isolate RangeRequest logic into DocumentLoader. Method OnPendingRequestComplete is called, when we receive requested data (main connection, or Range connection). (like tape playing without rewing).
> >  4) Fill this logic by tests.
> >
> >  Example URL:
> >  http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
> >  Comparison of changes:
> >  https://drive.google.com/file/d/0BzWfMBOuik2QNGg0SG93Y3lpUlE/view?usp=sharing
> >
> > Change-Id: I97bb25d2e82bcb4ba2e060af8128f49b9c0680d9
> > Reviewed-on: https://chromium-review.googlesource.com/581292
> > Reviewed-by: Robert Sesek <rsesek@chromium.org>
> > Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
> > Commit-Queue: Art Snake <art-snake@yandex-team.ru>
> > Cr-Commit-Position: refs/heads/master@{#489755}
>
>

TBR=rsesek@chromium.org

Change-Id: I78e10565f639c26faae29b3cf854419208af8665
Reviewed-on: https://chromium-review.googlesource.com/615302
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: (000 09-08 - 09-18) dsinclair <dsinclair@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501344}
2017-09-12 18:48:24 +00:00
dsinclair
07a72bda87 Revert "Reland of Improve linearized pdf load/show time."
This reverts commit 9a6d148799.

Reason for revert: https://crbug.com/755061. This appears to be
causing a serious regression in loading. The loading bar does not
appear as expected and appears all at once at the end as the screen
displays. There is 5-6seconds of nothing happening which makes it look
like the browser has stopped working.


Original change's description:
> Reland of Improve linearized pdf load/show time.
> 
> XFA forms loading has been fixed.
> Now for document with single non XFA page, the form load first.
> This is necessary for correct loading pages, because in XFA document
> the page count and them contents may be changed after loading form.
> 
> See
> https://codereview.chromium.org/2558573002/
> 
> For test this:
>  build chromium pdf with XFA support
>  and open any document from
>  https://www.idrsolutions.com/jpdfforms/xfa-html5-example-conversions/
> 
> Original CL:
>  https://codereview.chromium.org/2455403002/
> 
> Original description:
>  Improve linearized pdf load/show time.
>  Reduce Pdf Plugin's count of reconnects.
>  Add tests for PDFPlugin DocumentLoader.
> 
>  DocumentLoader was splitted into separate components, and missing tests was added for them.
> 
>  The main ideas in this CL are:
> 
>  1) Do not reset browser initiated connection at start (includes case when we can use range requests), if we request data near current downloading position.
>  2) Request as much data as we can on each request, and continue loading data using current range request. (like tape rewind)
>  3) Isolate RangeRequest logic into DocumentLoader. Method OnPendingRequestComplete is called, when we receive requested data (main connection, or Range connection). (like tape playing without rewing).
>  4) Fill this logic by tests.
> 
>  Example URL:
>  http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
>  Comparison of changes:
>  https://drive.google.com/file/d/0BzWfMBOuik2QNGg0SG93Y3lpUlE/view?usp=sharing
> 
> Change-Id: I97bb25d2e82bcb4ba2e060af8128f49b9c0680d9
> Reviewed-on: https://chromium-review.googlesource.com/581292
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
> Cr-Commit-Position: refs/heads/master@{#489755}

TBR=raymes@chromium.org,thestig@chromium.org,dsinclair@chromium.org,tsepez@chromium.org,rsesek@chromium.org,art-snake@yandex-team.ru

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I3a2fe60e6dac9a88409f225e84e680596930cae8
Reviewed-on: https://chromium-review.googlesource.com/614590
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494240}
2017-08-14 23:27:04 +00:00
Artem Strygin
9a6d148799 Reland of Improve linearized pdf load/show time.
XFA forms loading has been fixed.
Now for document with single non XFA page, the form load first.
This is necessary for correct loading pages, because in XFA document
the page count and them contents may be changed after loading form.

See
https://codereview.chromium.org/2558573002/

For test this:
 build chromium pdf with XFA support
 and open any document from
 https://www.idrsolutions.com/jpdfforms/xfa-html5-example-conversions/

Original CL:
 https://codereview.chromium.org/2455403002/

Original description:
 Improve linearized pdf load/show time.
 Reduce Pdf Plugin's count of reconnects.
 Add tests for PDFPlugin DocumentLoader.

 DocumentLoader was splitted into separate components, and missing tests was added for them.

 The main ideas in this CL are:

 1) Do not reset browser initiated connection at start (includes case when we can use range requests), if we request data near current downloading position.
 2) Request as much data as we can on each request, and continue loading data using current range request. (like tape rewind)
 3) Isolate RangeRequest logic into DocumentLoader. Method OnPendingRequestComplete is called, when we receive requested data (main connection, or Range connection). (like tape playing without rewing).
 4) Fill this logic by tests.

 Example URL:
 http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
 Comparison of changes:
 https://drive.google.com/file/d/0BzWfMBOuik2QNGg0SG93Y3lpUlE/view?usp=sharing

Change-Id: I97bb25d2e82bcb4ba2e060af8128f49b9c0680d9
Reviewed-on: https://chromium-review.googlesource.com/581292
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Cr-Commit-Position: refs/heads/master@{#489755}
2017-07-26 21:08:56 +00:00
dsinclair
adf55f3f29 Revert "reland of Improve linearized pdf load/show time."
This Cl reverts the linearized loading Cl. In order to do so it also reverst:

 * "Fix crash in Print Preview on rotating the preview in 'Clockwise' direction.."
 * "[PDF Plugin] Increase read buffer size"

The reason for revert is due to breaking loading of dynamic XFA forms.

Review-Url: https://codereview.chromium.org/2558573002
Cr-Commit-Position: refs/heads/master@{#436938}
2016-12-07 14:03:45 +00:00
art-snake
3704ccf020 Reland of Improve linearized pdf load/show time.
Original issue's description:
> Improve linearized pdf load/show time.
> Reduce Pdf Plugin's count of reconnects.
> Add tests for PDFPlugin DocumentLoader.
>
> DocumentLoader was splitted into separate components, and missing tests was added for them.
>
> The main ideas in this CL are:
>
> 1) Do not reset browser initiated connection at start (includes case when we can use range requests), if we request data near current downloading position.
> 2) Request as much data as we can on each request, and continue loading data using current range request. (like tape rewind)
> 3) Isolate RangeRequest logic into DocumentLoader.  Method OnPendingRequestComplete is called, when we receive requested data (main connection, or Range connection). (like tape playing without rewing).
> 4) Fill this logic by tests.
>
> Example URL:
> http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
> Comparison of changes:
> https://drive.google.com/file/d/0BzWfMBOuik2QNGg0SG93Y3lpUlE/view?usp=sharing
>
> Committed: https://crrev.com/7fd7423cdee0dba84faf480d10dd66dcb57110d9
> Cr-Commit-Position: refs/heads/master@{#427752}

Original review:
https://codereview.chromium.org/2349753003/

Review-Url: https://codereview.chromium.org/2455403002
Cr-Commit-Position: refs/heads/master@{#429514}
2016-11-03 02:15:16 +00:00
thestig
ca52440d2d Revert of Improve linearized pdf load/show time. (patchset id:1 of https://codereview.chromium.org/2449973004/ )
Reason for revert:
Still breaks the tree. The initial revert failed due to funny merging by the CQ in reaction to r427683.

Original issue's description:
> Reland of Improve linearized pdf load/show time. (patchset  id:1 of https://codereview.chromium.org/2458493002/ )
>
> Reason for revert:
> As suggested FindIt, this reverting CL is also causing the tree closure.
>
> Original issue's description:
> > Revert of Improve linearized pdf load/show time. (patchset  id:340001 of https://codereview.chromium.org/2349753003/ )
> >
> > Reason for revert:
> > https://build.chromium.org/p/chromium/builders/Win%20x64/builds/5423/steps/compile/logs/stdio
> >
> > FAILED: obj/pdf/pdf_unittests/document_loader_unittest.obj
> > pdf\document_loader_unittest.cc(631): error C2131: expression did not evaluate to a constant
> > pdf\document_loader_unittest.cc(631): note: failure was caused by call of undefined function or one not declared 'constexpr'
> > pdf\document_loader_unittest.cc(631): note: see usage of 'chrome_pdf::DocumentLoader::default_request_size'
> >
> >
> > Original issue's description:
> > > Improve linearized pdf load/show time.
> > > Reduce Pdf Plugin's count of reconnects.
> > > Add tests for PDFPlugin DocumentLoader.
> > >
> > > DocumentLoader was splitted into separate components, and missing tests was added for them.
> > >
> > > The main ideas in this CL are:
> > >
> > > 1) Do not reset browser initiated connection at start (includes case when we can use range requests), if we request data near current downloading position.
> > > 2) Request as much data as we can on each request, and continue loading data using current range request. (like tape rewind)
> > > 3) Isolate RangeRequest logic into DocumentLoader.  Method OnPendingRequestComplete is called, when we receive requested data (main connection, or Range connection). (like tape playing without rewing).
> > > 4) Fill this logic by tests.
> > >
> > > Example URL:
> > > http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
> > > Comparison of changes:
> > > https://drive.google.com/file/d/0BzWfMBOuik2QNGg0SG93Y3lpUlE/view?usp=sharing
> > >
> > > Committed: https://crrev.com/7fd7423cdee0dba84faf480d10dd66dcb57110d9
> > > Cr-Commit-Position: refs/heads/master@{#427752}
> >
> > TBR=jochen@chromium.org,raymes@chromium.org,spelchat@chromium.org,rsesek@chromium.org,art-snake@yandex-team.ru
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
>
> TBR=jochen@chromium.org,raymes@chromium.org,spelchat@chromium.org,rsesek@chromium.org,art-snake@yandex-team.ru,thestig@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://crrev.com/47b9a19cb7219538a26e0f1388fd01adac709b98
> Cr-Commit-Position: refs/heads/master@{#427782}

TBR=jochen@chromium.org,raymes@chromium.org,spelchat@chromium.org,rsesek@chromium.org,art-snake@yandex-team.ru,hongchan@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2456653002
Cr-Commit-Position: refs/heads/master@{#427784}
2016-10-26 20:46:49 +00:00
hongchan
47b9a19cb7 Reland of Improve linearized pdf load/show time. (patchset id:1 of https://codereview.chromium.org/2458493002/ )
Reason for revert:
As suggested FindIt, this reverting CL is also causing the tree closure.

Original issue's description:
> Revert of Improve linearized pdf load/show time. (patchset  id:340001 of https://codereview.chromium.org/2349753003/ )
>
> Reason for revert:
> https://build.chromium.org/p/chromium/builders/Win%20x64/builds/5423/steps/compile/logs/stdio
>
> FAILED: obj/pdf/pdf_unittests/document_loader_unittest.obj
> pdf\document_loader_unittest.cc(631): error C2131: expression did not evaluate to a constant
> pdf\document_loader_unittest.cc(631): note: failure was caused by call of undefined function or one not declared 'constexpr'
> pdf\document_loader_unittest.cc(631): note: see usage of 'chrome_pdf::DocumentLoader::default_request_size'
>
>
> Original issue's description:
> > Improve linearized pdf load/show time.
> > Reduce Pdf Plugin's count of reconnects.
> > Add tests for PDFPlugin DocumentLoader.
> >
> > DocumentLoader was splitted into separate components, and missing tests was added for them.
> >
> > The main ideas in this CL are:
> >
> > 1) Do not reset browser initiated connection at start (includes case when we can use range requests), if we request data near current downloading position.
> > 2) Request as much data as we can on each request, and continue loading data using current range request. (like tape rewind)
> > 3) Isolate RangeRequest logic into DocumentLoader.  Method OnPendingRequestComplete is called, when we receive requested data (main connection, or Range connection). (like tape playing without rewing).
> > 4) Fill this logic by tests.
> >
> > Example URL:
> > http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
> > Comparison of changes:
> > https://drive.google.com/file/d/0BzWfMBOuik2QNGg0SG93Y3lpUlE/view?usp=sharing
> >
> > Committed: https://crrev.com/7fd7423cdee0dba84faf480d10dd66dcb57110d9
> > Cr-Commit-Position: refs/heads/master@{#427752}
>
> TBR=jochen@chromium.org,raymes@chromium.org,spelchat@chromium.org,rsesek@chromium.org,art-snake@yandex-team.ru
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true

TBR=jochen@chromium.org,raymes@chromium.org,spelchat@chromium.org,rsesek@chromium.org,art-snake@yandex-team.ru,thestig@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2449973004
Cr-Commit-Position: refs/heads/master@{#427782}
2016-10-26 20:00:27 +00:00
thestig
eb1b563148 Revert of Improve linearized pdf load/show time. (patchset id:340001 of https://codereview.chromium.org/2349753003/ )
Reason for revert:
https://build.chromium.org/p/chromium/builders/Win%20x64/builds/5423/steps/compile/logs/stdio

FAILED: obj/pdf/pdf_unittests/document_loader_unittest.obj
pdf\document_loader_unittest.cc(631): error C2131: expression did not evaluate to a constant
pdf\document_loader_unittest.cc(631): note: failure was caused by call of undefined function or one not declared 'constexpr'
pdf\document_loader_unittest.cc(631): note: see usage of 'chrome_pdf::DocumentLoader::default_request_size'

Original issue's description:
> Improve linearized pdf load/show time.
> Reduce Pdf Plugin's count of reconnects.
> Add tests for PDFPlugin DocumentLoader.
>
> DocumentLoader was splitted into separate components, and missing tests was added for them.
>
> The main ideas in this CL are:
>
> 1) Do not reset browser initiated connection at start (includes case when we can use range requests), if we request data near current downloading position.
> 2) Request as much data as we can on each request, and continue loading data using current range request. (like tape rewind)
> 3) Isolate RangeRequest logic into DocumentLoader.  Method OnPendingRequestComplete is called, when we receive requested data (main connection, or Range connection). (like tape playing without rewing).
> 4) Fill this logic by tests.
>
> Example URL:
> http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
> Comparison of changes:
> https://drive.google.com/file/d/0BzWfMBOuik2QNGg0SG93Y3lpUlE/view?usp=sharing
>
> Committed: https://crrev.com/7fd7423cdee0dba84faf480d10dd66dcb57110d9
> Cr-Commit-Position: refs/heads/master@{#427752}

TBR=jochen@chromium.org,raymes@chromium.org,spelchat@chromium.org,rsesek@chromium.org,art-snake@yandex-team.ru
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2458493002
Cr-Commit-Position: refs/heads/master@{#427772}
2016-10-26 19:25:07 +00:00
art-snake
7fd7423cde Improve linearized pdf load/show time.
Reduce Pdf Plugin's count of reconnects.
Add tests for PDFPlugin DocumentLoader.

DocumentLoader was splitted into separate components, and missing tests was added for them.

The main ideas in this CL are:

1) Do not reset browser initiated connection at start (includes case when we can use range requests), if we request data near current downloading position.
2) Request as much data as we can on each request, and continue loading data using current range request. (like tape rewind)
3) Isolate RangeRequest logic into DocumentLoader.  Method OnPendingRequestComplete is called, when we receive requested data (main connection, or Range connection). (like tape playing without rewing).
4) Fill this logic by tests.

Example URL:
http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
Comparison of changes:
https://drive.google.com/file/d/0BzWfMBOuik2QNGg0SG93Y3lpUlE/view?usp=sharing

Review-Url: https://codereview.chromium.org/2349753003
Cr-Commit-Position: refs/heads/master@{#427752}
2016-10-26 18:29:07 +00:00