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

Issue 2455663004: Add test to ensure that URLs that redirect inside the PDF plugin fail to load (Closed)

Created:
4 years, 1 month ago by raymes
Modified:
4 years, 1 month ago
Reviewers:
Lei Zhang, snake, spelchat
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, arv+watch_chromium.org, extensions-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add test to ensure that URLs that redirect inside the PDF plugin fail to load A URL that is passed to the PDF plugin should already have its redirects resolved. If it doesn't, then the PDF that gets loaded may not have the same origin as the one the PDF is assumed to be in. If that happens, it can cause same origin policy violations. So redirects are disabled for requests made from the plugin. Redirects were disabled here: https://codereview.chromium.org/2409423004/. There is one other place where we make a request in the plugin which has disabled in this CL (the URLs that get loaded here are chrome internal URLs so they should never trigger redirects anyway but this is done for safety). This CL also adds some plumbing to ensure the redirect requests trigger a document load failure message to be sent to JS so that we can properly detect the load failure in tests. BUG=653749 Committed: https://crrev.com/a8563ff4076d3ee37db3aaa85cf5226a8922e30f Cr-Commit-Position: refs/heads/master@{#432293}

Patch Set 1 #

Patch Set 2 #

Patch Set 3 #

Total comments: 6

Patch Set 4 #

Patch Set 5 #

Total comments: 11

Patch Set 6 #

Total comments: 2

Patch Set 7 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -15 lines) Patch
M chrome/browser/pdf/pdf_extension_test.cc View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/pdf/redirects_fail_test.js View 1 2 3 1 chunk +77 lines, -0 lines 0 comments Download
M pdf/document_loader.cc View 1 2 3 4 3 chunks +16 lines, -6 lines 0 comments Download
M pdf/out_of_process_instance.cc View 1 2 3 4 5 2 chunks +2 lines, -8 lines 0 comments Download
M pdf/pdfium/pdfium_engine.cc View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 49 (28 generated)
raymes
Let me know if you're busy and I can ask sammc to review. Thanks!
4 years, 1 month ago (2016-11-03 06:50:37 UTC) #7
Lei Zhang
r429514 landed, so you need to merge and resolve conflicts.
4 years, 1 month ago (2016-11-03 07:04:01 UTC) #8
Lei Zhang
https://codereview.chromium.org/2455663004/diff/40001/chrome/test/data/pdf/redirects_fail_test.js File chrome/test/data/pdf/redirects_fail_test.js (right): https://codereview.chromium.org/2455663004/diff/40001/chrome/test/data/pdf/redirects_fail_test.js#newcode10 chrome/test/data/pdf/redirects_fail_test.js:10: console.error(url); Debug code? https://codereview.chromium.org/2455663004/diff/40001/pdf/document_loader.cc File pdf/document_loader.cc (right): https://codereview.chromium.org/2455663004/diff/40001/pdf/document_loader.cc#newcode22 pdf/document_loader.cc:22: ...
4 years, 1 month ago (2016-11-03 07:10:45 UTC) #9
raymes
Thanks! ptal https://codereview.chromium.org/2455663004/diff/40001/chrome/test/data/pdf/redirects_fail_test.js File chrome/test/data/pdf/redirects_fail_test.js (right): https://codereview.chromium.org/2455663004/diff/40001/chrome/test/data/pdf/redirects_fail_test.js#newcode10 chrome/test/data/pdf/redirects_fail_test.js:10: console.error(url); On 2016/11/03 07:10:45, Lei Zhang wrote: ...
4 years, 1 month ago (2016-11-07 03:25:44 UTC) #18
Lei Zhang
Looks fine, but I'm not 100% certain on the pdfium_engine.cc change. https://codereview.chromium.org/2455663004/diff/80001/chrome/browser/pdf/pdf_extension_test.cc File chrome/browser/pdf/pdf_extension_test.cc (right): ...
4 years, 1 month ago (2016-11-08 01:28:10 UTC) #22
raymes
https://codereview.chromium.org/2455663004/diff/80001/chrome/browser/pdf/pdf_extension_test.cc File chrome/browser/pdf/pdf_extension_test.cc (right): https://codereview.chromium.org/2455663004/diff/80001/chrome/browser/pdf/pdf_extension_test.cc#newcode914 chrome/browser/pdf/pdf_extension_test.cc:914: // Test that if the plugin tries to load ...
4 years, 1 month ago (2016-11-08 06:00:01 UTC) #23
Lei Zhang
Looks good. Will stamp (and CQ?) once you work out the PDFiumEngine::OnDocumentCanceled() bit. https://codereview.chromium.org/2455663004/diff/80001/pdf/out_of_process_instance.cc File ...
4 years, 1 month ago (2016-11-08 07:19:31 UTC) #26
snake
https://codereview.chromium.org/2455663004/diff/80001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (left): https://codereview.chromium.org/2455663004/diff/80001/pdf/pdfium/pdfium_engine.cc#oldcode1109 pdf/pdfium/pdfium_engine.cc:1109: OnDocumentComplete(); On 2016/11/08 06:00:01, raymes wrote: > On 2016/11/08 ...
4 years, 1 month ago (2016-11-08 15:11:25 UTC) #29
spelchat
https://codereview.chromium.org/2455663004/diff/80001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (left): https://codereview.chromium.org/2455663004/diff/80001/pdf/pdfium/pdfium_engine.cc#oldcode1109 pdf/pdfium/pdfium_engine.cc:1109: OnDocumentComplete(); On 2016/11/08 15:11:25, snake wrote: > On 2016/11/08 ...
4 years, 1 month ago (2016-11-08 17:53:33 UTC) #30
raymes
On 2016/11/08 17:53:33, spelchat wrote: > https://codereview.chromium.org/2455663004/diff/80001/pdf/pdfium/pdfium_engine.cc > File pdf/pdfium/pdfium_engine.cc (left): > > https://codereview.chromium.org/2455663004/diff/80001/pdf/pdfium/pdfium_engine.cc#oldcode1109 > ...
4 years, 1 month ago (2016-11-09 03:33:43 UTC) #31
snake
https://codereview.chromium.org/2455663004/diff/100001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2455663004/diff/100001/pdf/pdfium/pdfium_engine.cc#newcode1109 pdf/pdfium/pdfium_engine.cc:1109: client_->DocumentLoadFailed(); May be more better?: if (visible_pages_.empty()) { client_->DocumentLoadFailed(); ...
4 years, 1 month ago (2016-11-09 14:27:28 UTC) #32
spelchat
On 2016/11/09 03:33:43, raymes wrote: > On 2016/11/08 17:53:33, spelchat wrote: > > > https://codereview.chromium.org/2455663004/diff/80001/pdf/pdfium/pdfium_engine.cc ...
4 years, 1 month ago (2016-11-09 17:31:42 UTC) #33
raymes
https://codereview.chromium.org/2455663004/diff/100001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2455663004/diff/100001/pdf/pdfium/pdfium_engine.cc#newcode1109 pdf/pdfium/pdfium_engine.cc:1109: client_->DocumentLoadFailed(); On 2016/11/09 14:27:28, snake wrote: > May be ...
4 years, 1 month ago (2016-11-14 00:36:09 UTC) #34
raymes
spelchat/snake PTAL. If it lg to you then I'll land (since I'm an owner and ...
4 years, 1 month ago (2016-11-15 03:13:02 UTC) #39
snake
On 2016/11/15 03:13:02, raymes wrote: > spelchat/snake PTAL. If it lg to you then I'll ...
4 years, 1 month ago (2016-11-15 15:32:10 UTC) #40
Lei Zhang
lgtm
4 years, 1 month ago (2016-11-15 18:39:33 UTC) #41
spelchat
lgtm lgtm
4 years, 1 month ago (2016-11-15 19:35:20 UTC) #42
raymes
On 2016/11/15 19:35:20, spelchat wrote: > lgtm > > lgtm Thanks all!
4 years, 1 month ago (2016-11-15 21:41:52 UTC) #44
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/2455663004/120001
4 years, 1 month ago (2016-11-15 21:42:16 UTC) #45
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 1 month ago (2016-11-15 23:50:31 UTC) #47
commit-bot: I haz the power
4 years, 1 month ago (2016-11-15 23:52:40 UTC) #49
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/a8563ff4076d3ee37db3aaa85cf5226a8922e30f
Cr-Commit-Position: refs/heads/master@{#432293}

Powered by Google App Engine
This is Rietveld 408576698