summaryrefslogtreecommitdiffstats
path: root/pdf/out_of_process_instance.cc
diff options
context:
space:
mode:
authorraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-31 22:45:50 +0000
committerraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-31 22:45:50 +0000
commit69fe5c7781ebd5e85fd76f51b2438967d43dce5d (patch)
tree04377c402fd720e79a45e10b65bb5bbe304a7958 /pdf/out_of_process_instance.cc
parent6273e79e2138d889bd228d0bfca59ca5e713ab49 (diff)
downloadchromium_src-69fe5c7781ebd5e85fd76f51b2438967d43dce5d.zip
chromium_src-69fe5c7781ebd5e85fd76f51b2438967d43dce5d.tar.gz
chromium_src-69fe5c7781ebd5e85fd76f51b2438967d43dce5d.tar.bz2
Fix loading PDFs with no HTTP response headers in OOP PDF
Currently if no response headers are passed into the plugin in OOP PDF then the headers fetched URLLoader that loaded the stream URL will be used, but the MIME type for the blob URL is always plain text, which causes the document loader to refuse to load the document. Currently, if no headers are passed to the in process plugin, we always try to load the document, so this just mimics that behavior in the OOP plugin. When the in-process plugin is removed we can change the document loader and remove the hack. This also removes blob: URLs from the MIME type check in document loader because they are no longer ever passed in. BUG=303491 Review URL: https://codereview.chromium.org/301223004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274081 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'pdf/out_of_process_instance.cc')
-rw-r--r--pdf/out_of_process_instance.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index ad1c656..49b14ee 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -316,6 +316,12 @@ bool OutOfProcessInstance::Init(uint32_t argc,
headers = argv[i];
}
+ // TODO(raymes): This is a hack to ensure that if no headers are passed in
+ // then we get the right MIME type. When the in process plugin is removed we
+ // can fix the document loader properly and remove this hack.
+ if (!headers || strcmp(headers, "") == 0)
+ headers = "content-type: application/pdf";
+
if (!original_url)
return false;