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}
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}
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}
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}
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}
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}
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}
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}
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}