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

Issue 2349753003: Improve linearized pdf load/show time. (Closed)

Created:
4 years, 3 months ago by snake
Modified:
4 years, 1 month ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

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}

Patch Set 1 #

Patch Set 2 : remove useless code. #

Total comments: 31

Patch Set 3 : Fix compilation and review issues. #

Patch Set 4 : Fix compilation and review issues. #

Patch Set 5 : Fix compilation on linux. #

Patch Set 6 : Fix heap use after free. #

Total comments: 14

Patch Set 7 : Fix review issues. #

Patch Set 8 : Some improvement. #

Total comments: 7

Patch Set 9 : Update tests.. #

Patch Set 10 : Update tests.. #

Total comments: 12

Patch Set 11 : Fix review issues. #

Total comments: 102

Patch Set 12 : fix review issues. #

Total comments: 20

Patch Set 13 : fix review issues. #

Total comments: 29

Patch Set 14 : fix review issues and compilation. #

Total comments: 6

Patch Set 15 : fix review issues. #

Total comments: 2

Patch Set 16 : fix compilation on linux. #

Patch Set 17 : fix compilation on linux. #

Patch Set 18 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2972 lines, -746 lines) Patch
M pdf/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +29 lines, -1 line 0 comments Download
M pdf/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M pdf/chunk_stream.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +80 lines, -23 lines 0 comments Download
D pdf/chunk_stream.cc View 1 chunk +0 lines, -175 lines 0 comments Download
A pdf/chunk_stream_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +99 lines, -0 lines 0 comments Download
M pdf/document_loader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +48 lines, -62 lines 0 comments Download
M pdf/document_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +240 lines, -394 lines 0 comments Download
A pdf/document_loader_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1184 lines, -0 lines 0 comments Download
M pdf/out_of_process_instance.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M pdf/out_of_process_instance.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -9 lines 0 comments Download
M pdf/pdf_engine.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 0 comments Download
M pdf/pdfium/pdfium_engine.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +11 lines, -6 lines 0 comments Download
M pdf/pdfium/pdfium_engine.cc View 1 2 3 4 5 6 7 8 9 10 11 16 chunks +88 lines, -70 lines 0 comments Download
M pdf/preview_mode_client.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M pdf/preview_mode_client.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
A pdf/range_set.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +77 lines, -0 lines 0 comments Download
A pdf/range_set.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +253 lines, -0 lines 0 comments Download
A pdf/range_set_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +303 lines, -0 lines 0 comments Download
A + pdf/run_all_unittests.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +11 lines, -4 lines 0 comments Download
A pdf/timer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +35 lines, -0 lines 0 comments Download
A pdf/timer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +31 lines, -0 lines 0 comments Download
A pdf/url_loader_wrapper.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +62 lines, -0 lines 0 comments Download
A pdf/url_loader_wrapper_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +89 lines, -0 lines 0 comments Download
A pdf/url_loader_wrapper_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +318 lines, -0 lines 0 comments Download

Messages

Total messages: 131 (65 generated)
snake
Anybody?
4 years, 3 months ago (2016-09-20 15:19:20 UTC) #8
Robert Sesek
On 2016/09/20 15:19:20, snake wrote: > Anybody? I don't think you Pubish+Mailed this CL out ...
4 years, 3 months ago (2016-09-20 17:21:08 UTC) #9
snake
4 years, 3 months ago (2016-09-20 18:17:04 UTC) #10
Robert Sesek
+thestig for PDF, and -rsesek I think you'll want to split this up into smaller, ...
4 years, 3 months ago (2016-09-20 19:10:25 UTC) #13
snake
On 2016/09/20 19:10:25, Robert Sesek wrote: > +thestig for PDF, and -rsesek > > I ...
4 years, 3 months ago (2016-09-20 19:13:55 UTC) #14
Lei Zhang
+spelchat if interested.
4 years, 3 months ago (2016-09-20 19:32:33 UTC) #16
snake
4 years, 3 months ago (2016-09-21 22:20:11 UTC) #17
snake
On 2016/09/21 22:20:11, snake wrote: Is that interesting for anybody?
4 years, 2 months ago (2016-09-26 10:20:57 UTC) #18
jochen (gone - plz use gerrit)
can you please send a design doc first (https://www.chromium.org/developers/new-features)?
4 years, 2 months ago (2016-09-26 15:09:55 UTC) #20
Lei Zhang
It might be easier to review if you do the chrome_pdf::DocumentLoader splitting in 1 CL, ...
4 years, 2 months ago (2016-09-28 23:21:33 UTC) #21
snake
On 2016/09/28 23:21:33, Lei Zhang wrote: > It might be easier to review if you ...
4 years, 2 months ago (2016-09-30 14:36:28 UTC) #22
Lei Zhang
On 2016/09/30 14:36:28, snake wrote: > On 2016/09/28 23:21:33, Lei Zhang wrote: > > It ...
4 years, 2 months ago (2016-10-05 07:15:32 UTC) #27
Lei Zhang
I'd be happy to run your patch sets through CQ. I'm not sure what build ...
4 years, 2 months ago (2016-10-05 07:18:08 UTC) #28
snake
https://codereview.chromium.org/2349753003/diff/20001/pdf/document_loader.h File pdf/document_loader.h (right): https://codereview.chromium.org/2349753003/diff/20001/pdf/document_loader.h#newcode12 pdf/document_loader.h:12: #include <map> On 2016/10/05 07:18:07, Lei Zhang wrote: > ...
4 years, 2 months ago (2016-10-05 14:14:11 UTC) #29
snake
On 2016/10/05 07:15:32, Lei Zhang wrote: > On 2016/09/30 14:36:28, snake wrote: > > On ...
4 years, 2 months ago (2016-10-05 14:21:36 UTC) #30
snake
On 2016/10/05 14:21:36, snake wrote: > On 2016/10/05 07:15:32, Lei Zhang wrote: > > On ...
4 years, 2 months ago (2016-10-06 12:34:14 UTC) #39
Lei Zhang
On 2016/10/06 12:34:14, snake wrote: > Compilations should be fixed. Can you run TryBots? Done. ...
4 years, 2 months ago (2016-10-06 20:39:00 UTC) #44
snake
On 2016/10/06 20:39:00, Lei Zhang wrote: > On 2016/10/06 12:34:14, snake wrote: > > Compilations ...
4 years, 2 months ago (2016-10-07 10:03:24 UTC) #45
snake
On 2016/10/07 10:03:24, snake wrote: > On 2016/10/06 20:39:00, Lei Zhang wrote: > > On ...
4 years, 2 months ago (2016-10-11 15:34:25 UTC) #46
Lei Zhang
On 2016/10/11 15:34:25, snake wrote: > What else should I do to commit this CL? ...
4 years, 2 months ago (2016-10-11 19:02:11 UTC) #49
spelchat
I've just started looking at this. I think I have a better idea of what ...
4 years, 2 months ago (2016-10-12 00:35:31 UTC) #52
spelchat
I've just started looking at this. I think I have a better idea of what ...
4 years, 2 months ago (2016-10-12 00:35:31 UTC) #53
spelchat
https://codereview.chromium.org/2349753003/diff/100001/pdf/document_loader.cc File pdf/document_loader.cc (right): https://codereview.chromium.org/2349753003/diff/100001/pdf/document_loader.cc#newcode68 pdf/document_loader.cc:68: if (type == "content-type: text/plain") { How can this ...
4 years, 2 months ago (2016-10-13 18:26:54 UTC) #54
snake
https://codereview.chromium.org/2349753003/diff/100001/pdf/chunk_stream.h File pdf/chunk_stream.h (right): https://codereview.chromium.org/2349753003/diff/100001/pdf/chunk_stream.h#newcode71 pdf/chunk_stream.h:71: (eof_pos_ && eof_pos_ < range.end())) On 2016/10/12 00:35:31, spelchat ...
4 years, 2 months ago (2016-10-14 11:31:17 UTC) #55
snake
https://codereview.chromium.org/2349753003/diff/140001/pdf/document_loader.cc File pdf/document_loader.cc (right): https://codereview.chromium.org/2349753003/diff/140001/pdf/document_loader.cc#newcode180 pdf/document_loader.cc:180: RangeSet candidates_for_request( readability is fixed. renamed: next_pending_requests --> candidates_for_request ...
4 years, 2 months ago (2016-10-14 11:40:52 UTC) #56
spelchat
https://codereview.chromium.org/2349753003/diff/140001/pdf/document_loader_unittest.cc File pdf/document_loader_unittest.cc (right): https://codereview.chromium.org/2349753003/diff/140001/pdf/document_loader_unittest.cc#newcode234 pdf/document_loader_unittest.cc:234: } This code desperately needed tests, thanks for that. ...
4 years, 2 months ago (2016-10-14 23:43:37 UTC) #57
snake
https://codereview.chromium.org/2349753003/diff/140001/pdf/document_loader_unittest.cc File pdf/document_loader_unittest.cc (right): https://codereview.chromium.org/2349753003/diff/140001/pdf/document_loader_unittest.cc#newcode234 pdf/document_loader_unittest.cc:234: } On 2016/10/14 23:43:37, spelchat wrote: > This code ...
4 years, 2 months ago (2016-10-18 12:37:18 UTC) #58
spelchat
Just minor grammar nits. Overall this lgtm. It would be nice to have another pair ...
4 years, 2 months ago (2016-10-18 16:12:44 UTC) #59
snake
https://codereview.chromium.org/2349753003/diff/180001/pdf/document_loader_unittest.cc File pdf/document_loader_unittest.cc (right): https://codereview.chromium.org/2349753003/diff/180001/pdf/document_loader_unittest.cc#newcode279 pdf/document_loader_unittest.cc:279: TEST_F(DocumentLoaderTest, PartialLoadingRealyDisabledRequestFromMiddle) { On 2016/10/18 16:12:44, spelchat wrote: > ...
4 years, 2 months ago (2016-10-18 17:00:58 UTC) #60
snake
On 2016/10/18 17:00:58, snake wrote: > https://codereview.chromium.org/2349753003/diff/180001/pdf/document_loader_unittest.cc > File pdf/document_loader_unittest.cc (right): > > https://codereview.chromium.org/2349753003/diff/180001/pdf/document_loader_unittest.cc#newcode279 > ...
4 years, 2 months ago (2016-10-18 17:12:13 UTC) #70
spelchat
On 2016/10/18 17:12:13, snake wrote: > On 2016/10/18 17:00:58, snake wrote: > > > https://codereview.chromium.org/2349753003/diff/180001/pdf/document_loader_unittest.cc ...
4 years, 2 months ago (2016-10-18 17:18:24 UTC) #71
snake
Lei Zhang, The main ideas in this CL are: 1) Do not reset browser initiated ...
4 years, 2 months ago (2016-10-18 17:33:08 UTC) #72
snake
> Yes, I'm not a Chromium committer (I'm reviewer on this CL because made changes ...
4 years, 2 months ago (2016-10-18 18:46:22 UTC) #73
snake
On 2016/10/18 17:33:08, snake wrote: > Lei Zhang, > > The main ideas in this ...
4 years, 2 months ago (2016-10-20 11:38:19 UTC) #74
Lei Zhang
On 2016/10/20 11:38:19, snake wrote: > Ping. Pong. I will look at this CL today/tomorrow.
4 years, 2 months ago (2016-10-21 00:50:06 UTC) #75
Lei Zhang
On 2016/10/18 17:33:08, snake wrote: > Lei Zhang, > > The main ideas in this ...
4 years, 2 months ago (2016-10-21 09:22:46 UTC) #76
Lei Zhang
https://codereview.chromium.org/2349753003/diff/20001/pdf/timer.h File pdf/timer.h (right): https://codereview.chromium.org/2349753003/diff/20001/pdf/timer.h#newcode35 pdf/timer.h:35: TestTimerRunner(); On 2016/10/05 14:14:10, snake wrote: > On 2016/10/05 ...
4 years, 2 months ago (2016-10-21 09:33:11 UTC) #77
snake
https://codereview.chromium.org/2349753003/diff/200001/pdf/BUILD.gn File pdf/BUILD.gn (right): https://codereview.chromium.org/2349753003/diff/200001/pdf/BUILD.gn#newcode7 pdf/BUILD.gn:7: import("//testing/test.gni") On 2016/10/21 09:33:08, Lei Zhang wrote: > nit: ...
4 years, 2 months ago (2016-10-21 15:13:16 UTC) #79
Lei Zhang
I previously had a question about the new Timer class vs base::Timer / base::MockTimer. Can ...
4 years, 1 month ago (2016-10-25 06:01:50 UTC) #84
Lei Zhang
https://codereview.chromium.org/2349753003/diff/220001/pdf/document_loader_unittest.cc File pdf/document_loader_unittest.cc (right): https://codereview.chromium.org/2349753003/diff/220001/pdf/document_loader_unittest.cc#newcode484 pdf/document_loader_unittest.cc:484: static_cast<int>(loader.GetDocumentSize())); For the try bot failure, you can get ...
4 years, 1 month ago (2016-10-25 06:04:29 UTC) #85
snake
https://codereview.chromium.org/2349753003/diff/200001/pdf/document_loader.h File pdf/document_loader.h (right): https://codereview.chromium.org/2349753003/diff/200001/pdf/document_loader.h#newcode27 pdf/document_loader.h:27: enum { kDefaultRequestSize = 65536 }; On 2016/10/25 06:01:49, ...
4 years, 1 month ago (2016-10-25 13:57:35 UTC) #86
Lei Zhang
I'm still thinking about making ChunkStream a template class. I will play with the code ...
4 years, 1 month ago (2016-10-25 18:24:52 UTC) #89
Lei Zhang
https://codereview.chromium.org/2349753003/diff/240001/pdf/url_loader_wrapper_impl.cc File pdf/url_loader_wrapper_impl.cc (right): https://codereview.chromium.org/2349753003/diff/240001/pdf/url_loader_wrapper_impl.cc#newcode19 pdf/url_loader_wrapper_impl.cc:19: namespace { Another place where it would be good ...
4 years, 1 month ago (2016-10-25 18:32:32 UTC) #90
snake
https://codereview.chromium.org/2349753003/diff/240001/pdf/document_loader_unittest.cc File pdf/document_loader_unittest.cc (right): https://codereview.chromium.org/2349753003/diff/240001/pdf/document_loader_unittest.cc#newcode251 pdf/document_loader_unittest.cc:251: } // namespace On 2016/10/25 18:24:52, Lei Zhang wrote: ...
4 years, 1 month ago (2016-10-25 19:16:27 UTC) #93
Lei Zhang
I'm not sure why the Linux trybots are failing. I can reproduce it locally, but ...
4 years, 1 month ago (2016-10-25 19:26:01 UTC) #94
Lei Zhang
https://codereview.chromium.org/2349753003/diff/240001/pdf/url_loader_wrapper_impl.cc File pdf/url_loader_wrapper_impl.cc (right): https://codereview.chromium.org/2349753003/diff/240001/pdf/url_loader_wrapper_impl.cc#newcode272 pdf/url_loader_wrapper_impl.cc:272: if ((buffer_[i - 1] == '\n' && buffer_[i - ...
4 years, 1 month ago (2016-10-25 19:40:37 UTC) #97
snake
https://codereview.chromium.org/2349753003/diff/200001/pdf/document_loader.cc File pdf/document_loader.cc (right): https://codereview.chromium.org/2349753003/diff/200001/pdf/document_loader.cc#newcode119 pdf/document_loader.cc:119: return chunk_stream_.ReadData(gfx::Range(position, position + size), buf); On 2016/10/25 19:26:00, ...
4 years, 1 month ago (2016-10-25 20:07:17 UTC) #98
Lei Zhang
https://codereview.chromium.org/2349753003/diff/260001/pdf/document_loader.h File pdf/document_loader.h (right): https://codereview.chromium.org/2349753003/diff/260001/pdf/document_loader.h#newcode27 pdf/document_loader.h:27: static const uint32_t kDefaultRequestSize = 65536; On 2016/10/25 20:07:17, ...
4 years, 1 month ago (2016-10-25 20:42:05 UTC) #99
snake
https://codereview.chromium.org/2349753003/diff/240001/pdf/chunk_stream.h File pdf/chunk_stream.h (right): https://codereview.chromium.org/2349753003/diff/240001/pdf/chunk_stream.h#newcode25 pdf/chunk_stream.h:25: static const uint32_t kChunkSize = N; On 2016/10/25 19:26:01, ...
4 years, 1 month ago (2016-10-25 20:44:59 UTC) #100
Lei Zhang
https://codereview.chromium.org/2349753003/diff/240001/pdf/url_loader_wrapper_impl.cc File pdf/url_loader_wrapper_impl.cc (right): https://codereview.chromium.org/2349753003/diff/240001/pdf/url_loader_wrapper_impl.cc#newcode31 pdf/url_loader_wrapper_impl.cc:31: request.SetFollowRedirects(true); On 2016/10/25 19:16:27, snake wrote: > On 2016/10/25 ...
4 years, 1 month ago (2016-10-25 20:51:58 UTC) #101
Lei Zhang
On 2016/10/25 20:44:59, snake wrote: > I found the workaround. Great. I think we just ...
4 years, 1 month ago (2016-10-25 20:54:35 UTC) #102
snake
https://codereview.chromium.org/2349753003/diff/280001/pdf/document_loader.cc File pdf/document_loader.cc (right): https://codereview.chromium.org/2349753003/diff/280001/pdf/document_loader.cc#newcode125 pdf/document_loader.cc:125: if (position > position + size) { On 2016/10/25 ...
4 years, 1 month ago (2016-10-25 21:07:46 UTC) #103
Lei Zhang
lgtm I started more try bots...
4 years, 1 month ago (2016-10-25 21:26:44 UTC) #105
Lei Zhang
BTW, the new pdf_unittests binary probably won't run automatically on bots. We need to change ...
4 years, 1 month ago (2016-10-25 21:28:07 UTC) #107
Lei Zhang
On 2016/10/25 22:20:25, commit-bot: I haz the power wrote: > Dry run: This issue passed ...
4 years, 1 month ago (2016-10-25 22:23:31 UTC) #110
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2349753003/340001
4 years, 1 month ago (2016-10-25 22:24:15 UTC) #113
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/289294)
4 years, 1 month ago (2016-10-25 22:35:57 UTC) #115
Lei Zhang
On 2016/10/25 22:35:57, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years, 1 month ago (2016-10-25 22:37:41 UTC) #118
Robert Sesek
DEPS lgtm
4 years, 1 month ago (2016-10-26 18:15:18 UTC) #119
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2349753003/340001
4 years, 1 month ago (2016-10-26 18:17:13 UTC) #121
commit-bot: I haz the power
Committed patchset #18 (id:340001)
4 years, 1 month ago (2016-10-26 18:26:16 UTC) #125
commit-bot: I haz the power
Patchset 18 (id:??) landed as https://crrev.com/7fd7423cdee0dba84faf480d10dd66dcb57110d9 Cr-Commit-Position: refs/heads/master@{#427752}
4 years, 1 month ago (2016-10-26 18:53:19 UTC) #127
Lei Zhang
A revert of this CL (patchset #18 id:340001) has been created in https://codereview.chromium.org/2458493002/ by thestig@chromium.org. ...
4 years, 1 month ago (2016-10-26 19:20:41 UTC) #128
findit-for-me
FYI: Findit identified this CL at revision 427752 as the culprit for failures in the ...
4 years, 1 month ago (2016-10-26 19:49:25 UTC) #129
Lei Zhang
On 2016/10/26 19:20:41, Lei Zhang wrote: > A revert of this CL (patchset #18 id:340001) ...
4 years, 1 month ago (2016-10-26 22:16:24 UTC) #130
Lei Zhang
4 years, 1 month ago (2016-10-26 22:16:59 UTC) #131
Message was sent while issue was closed.
On 2016/10/26 22:16:24, Lei Zhang wrote:
> If we take smaller steps instead a bigger leap, we may have been able to avoid
> this. e.g.

... instead _of_ a bigger ...

Powered by Google App Engine
This is Rietveld 408576698