Privacy Blacklist Unblock
Summary
-------
Mostly implemented the unblocking for visual resources for the Privacy Blacklist.
Merging now before I leave. Eveything here only has effect if the --privacy-blacklist
flag specifies a Privacy Blacklist.
Detailed Changes
----------------
[chrome/browser/resources/privacy_blacklist.html]
- Replaced the about:blank place-holder with variable to set the unblock link.
- Open the Privacy Blacklist provider page in a new tab. This works around an
issue where such request for a full-page (rather than a sub-resource) gets
blocked indefinitely.
[chrome/browser/render_host/resource_dispatcher_host.h]
- Added a BlockedResponse member which is now a class rather than a namespace,
see below for more information.
[chrome/browser/render_host/resource_dispatcher_host.cc]
- Generate headers for the blocked response to redirect to the chrome-blocked URL
which prevents an enclosing page from reading the URL of the unblock link. This
was suggested by Darin to avoid scripted bypassing of blocked contents.
- Recover the original URL for blocked content, in order to fetch it during
unblocking.
- Do not create CrossSiteResourceHandler when an unblocked link is requested.
Otherwise the request never resumes as the blocked page never gets closed
since it is not a real page.
[chrome/browser/privacy_blacklist/blocked_response.cc]
- Defined chrome-block and chrome-unblock URL schemes. The block scheme is used
to return the blocked response. The unblock scheme is used request a blocked
resource's URL without being intercepted by the Privacy Blacklist.
- Defined a hash function for a blocked resource as its address in memory.
Function to reverse the hash is therefore trivial.
- Added a function to return headers for a blocked response.
- Added a function to generate a block URL from a requested one.
- Added a function to get an unblock URL from a requested one.
- Added a function to return the original URL for a blocked one.
[chrome/browser/privacy_blacklist/blocked_response.h]
- Made the BlockedResponse namespace into a class.
- Created a member set to keep all the blocked resources URL.
BUG=
16932
TEST=none
TBR=darin
Committed:
http://src.chromium.org/viewvc/chrome?view=rev&revision=27719