Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 5231751647461376: Issue 1264 - Generate custom response for subdocument on subdomain request (Closed)

Sept. 5, 2014, 3:16 p.m. by sergei
Oct. 17, 2014, 3:36 p.m.


Here we feed the custom page as the response for the blocked subdocument. In this case iframe tag is even successfully hidden later by us, for the solution with failed redirection it was not hidden and the user sees something like "The page cannot be displayed". With such fix the youtube previews are successfully shown either with #1210 or without #1210. For testers: Please check how the resources are blocked with different mime types (js, image, css, xml, swf, etc) of subdomain requests. First of all it should not crash the browser, secondly it should work as it was or better. It correlates with #1265, be aware. Changes: - add `handled` argument to our protocol Sink `OnStart` method. When `handled` is set to true the original (target) protocol::Start is not called. Before it was up to the return code, if it's successful then call it. But we need to return the successful code and don't need the call of the original protocol impl because it messes the workflow and crashes. - rename `WBPassthruSink::Read` to `WBPassthruSink::OnRead`, because it's sink and its methods are some kind of slots and the proper names are `OnSomeEvent`, there is even already `OnStart`. - get rid of `WBPassthruSink::m_lastDataReported` because it's not used anymore. Add `WBPassthruSink::m_currentPositionOfSentPage` which is used by `WBPassthruSink::OnRead`. - move `WBPassthruSink::m_shouldBlock` to `WBPassthru::m_shouldSupplyCustomContent`. When we send custom response we don't initiate any original protocol calls, thus we don't need to call its LockRequest/UnlockRequest. They crash if original Start is not called. As well it cannot be in `WBPassthruSink` because it is destroyed before `UnlockRequest` is called.

Patch Set 1 #

Patch Set 2 : move opening braces on the new line #

Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -71 lines) Patch
M src/plugin/PluginWbPassThrough.h View 4 chunks +12 lines, -7 lines 0 comments Download
M src/plugin/PluginWbPassThrough.cpp View 1 7 chunks +84 lines, -62 lines 0 comments Download
M src/plugin/SinkPolicy.inl View 2 chunks +3 lines, -2 lines 0 comments Download


Total messages: 1
Sept. 5, 2014, 3:49 p.m. (2014-09-05 15:49:51 UTC) #1


Powered by Google App Engine
This is Rietveld