roadlabs / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

Render Process only CefURLRequests being aborted when response content mime type is an unsupported_text_types #1155

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using Multi process CEF-3 (Branch 1453)
2. In the render process's render thread, create a CefURLRequest to content 
that will respond with an unsupported text type listed in 
unsupported_text_types in mime_util.cc [1], e.g. "text/csv"
3. The CefURLRequest will be aborted in the browser process at, 
buffered_resource_handler.cc:379 
BufferedResourceHandler::UseAlternateNextHandler  [2]

What is the expected output? What do you see instead?

The request should not of been aborted, and the content of the requested url 
should of been provided to the CefURLRequestClient's callbacks. The same 
request made from the browser process does not encounter this problem.

What version of the product are you using? On what operating system?

Cef 3 Branch 1453, multiprocess, Windows 7 and OSX 10.8 64 bit.

Please provide any additional information below.

CefURLRequest made from the render process are treated as if they were made 
from the browser window's main frame. This is why some mime-type of content 
being requested would cause the request to be canceled deep within Chromium. 
Since the request appears to be coming from the browser window's main frame 
Chromium applies its logic which will determine if the content should be 
rendered or downloaded(buffered_resource_handler.cc:378). Attributes such as 
content-disposition header, or mime-type which are not expected to be rendered, 
will cause Chromium to cancel the initial request, and create a new 
ResourceHandler to download the content of the request. This is what causes the 
UR_FAILED, ERR_ABORTED.

So with this knowledge If at CEF's render_urlrequest_impl.cc:112 [3] the 
WebURLRequest urlRequest's target type was set to something else, such as 
WebURLRequest::TargetIsXHR the CefURLRequest is able to make requests to 
content without regard to mime-type or content-disposition headers. Which I 
think is probably the correct result of CefURLRequest calls made from the 
render process. This makes render process CefURLRequest calls perform similar 
to those called from the browser process.

Attached is a patch file which sets the request type to XHR.

[1]: http://src.chromium.org/viewvc/chrome/trunk/src/net/base/mime_util.cc
[2]: 
http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/loader/buffered_
resource_handler.cc
[3]: 
https://code.google.com/p/chromiumembedded/source/browse/branches/1453/cef3/libc
ef/renderer/render_urlrequest_impl.cc#112

Original issue reported on code.google.com by delpon...@gmail.com on 13 Dec 2013 at 5:51

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for the detailed bug report. Related forum topic: 
http://magpcss.org/ceforum/viewtopic.php?f=6&t=10926

Original comment by magreenb...@gmail.com on 13 Dec 2013 at 6:05

GoogleCodeExporter commented 9 years ago
Can you add a unit test for this behavior?

Original comment by magreenb...@gmail.com on 10 Jan 2014 at 7:00

GoogleCodeExporter commented 9 years ago
Will do, I'll write one up over the weekend, and add it to this bug.

Original comment by delpon...@gmail.com on 17 Jan 2014 at 6:09

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 2 Jul 2014 at 11:24

GoogleCodeExporter commented 9 years ago
CEF is transitioning from Google Code to Bitbucket project hosting. If you 
would like to continue receiving notifications on this issue please add 
yourself as a Watcher at the new location: 
https://bitbucket.org/chromiumembedded/cef/issue/1155

Original comment by magreenb...@gmail.com on 14 Mar 2015 at 3:29