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

Issue 501082: Implement delaying resource requests until privacy blacklists are ready. (Closed)

Created:
11 years ago by Paweł Hajdan Jr.
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, plz use chromium.org account
Visibility:
Public.

Description

Implement delaying resource requests until privacy blacklists are ready. Associate a BlacklistRequestInfo with each URLRequest started by ResourceDispatcherHost so that in various places we get access to the right BlacklistManager (each Profile has its own), and lazily cache a Blacklist::Match. BlacklistListener controls delaying requests until the privacy blacklist is ready for the request. BlacklistInterceptor handles substituting real response with a blocking page or blocking image. I've temporarily removed support for unblocking things. It was too hacky. This change also removes a large block of blacklist-related code from RDH to more focused classes. Should make it a little more readable. This should also make BlacklistManagerBrowserTest not flaky. TEST=Covered by browser_tests and unit_tests. BUG=21541, 29113 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=35538

Patch Set 1 #

Patch Set 2 : fixes #

Total comments: 44

Patch Set 3 : updates #

Patch Set 4 : better #

Patch Set 5 : reupload on HTTP 500 #

Patch Set 6 : update #

Patch Set 7 : now with a test for BlacklistListener #

Total comments: 9

Patch Set 8 : fixes #

Patch Set 9 : don't get stuck on errors #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1075 lines, -517 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.h View 1 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.cc View 1 2 3 4 5 6 7 8 2 chunks +51 lines, -34 lines 0 comments Download
M chrome/browser/privacy_blacklist/blacklist.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/privacy_blacklist/blacklist.cc View 1 chunk +0 lines, -3 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_interceptor.h View 1 chunk +23 lines, -0 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_interceptor.cc View 1 2 3 4 5 6 7 1 chunk +141 lines, -0 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_interceptor_unittest.cc View 1 2 3 4 5 1 chunk +94 lines, -0 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_listener.h View 1 2 3 4 5 6 7 1 chunk +68 lines, -0 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_listener.cc View 1 2 3 4 5 6 7 8 1 chunk +92 lines, -0 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_listener_unittest.cc View 7 1 chunk +183 lines, -0 lines 0 comments Download
M chrome/browser/privacy_blacklist/blacklist_manager.h View 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/privacy_blacklist/blacklist_manager.cc View 5 chunks +42 lines, -7 lines 0 comments Download
M chrome/browser/privacy_blacklist/blacklist_manager_browsertest.cc View 4 chunks +10 lines, -39 lines 0 comments Download
M chrome/browser/privacy_blacklist/blacklist_manager_unittest.cc View 1 2 3 4 5 4 chunks +7 lines, -90 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_request_info.h View 1 2 3 4 5 6 7 1 chunk +47 lines, -0 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_request_info.cc View 1 2 3 4 5 6 7 1 chunk +29 lines, -0 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_test_util.h View 1 2 3 4 5 6 1 chunk +64 lines, -0 lines 0 comments Download
A chrome/browser/privacy_blacklist/blacklist_test_util.cc View 1 2 1 chunk +76 lines, -0 lines 0 comments Download
M chrome/browser/privacy_blacklist/blacklist_ui.cc View 1 2 3 4 5 6 7 3 chunks +31 lines, -25 lines 0 comments Download
D chrome/browser/privacy_blacklist/blocked_response.h View 1 chunk +0 lines, -57 lines 0 comments Download
D chrome/browser/privacy_blacklist/blocked_response.cc View 1 chunk +0 lines, -104 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.h View 3 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.cc View 1 2 3 4 5 6 7 8 chunks +32 lines, -83 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.cc View 1 2 3 4 5 3 chunks +23 lines, -14 lines 0 comments Download
M chrome/browser/resources/privacy_blacklist_block.html View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -3 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -1 line 0 comments Download
M net/url_request/url_request_unittest.h View 1 3 chunks +34 lines, -10 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 1 chunk +0 lines, -33 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Paweł Hajdan Jr.
Sorry for a big patch for review. I had to rip out many things in ...
11 years ago (2009-12-17 18:49:50 UTC) #1
Paweł Hajdan Jr.
ping. I noticed the ui_tests failures, going to fix them. But please review the code ...
11 years ago (2009-12-18 06:50:05 UTC) #2
Paweł Hajdan Jr.
Patch updated to fix ui_tests failures. Please review.
11 years ago (2009-12-18 15:45:21 UTC) #3
Erik does not do reviews
I only looked at browser/privacy_blacklist/* http://codereview.chromium.org/501082/diff/4001/2007 File chrome/browser/privacy_blacklist/blacklist_interceptor.cc (right): http://codereview.chromium.org/501082/diff/4001/2007#newcode31 chrome/browser/privacy_blacklist/blacklist_interceptor.cc:31: if (request_info_.is_main_frame()) { does ...
11 years ago (2009-12-18 23:58:01 UTC) #4
Paweł Hajdan Jr.
I think things are at least a bit better than in the previous version. Thanks ...
10 years, 12 months ago (2009-12-29 08:47:10 UTC) #5
Paweł Hajdan Jr.
I've added a test for BlacklistListener. Please take a look. I'm sorry that this review ...
10 years, 11 months ago (2010-01-04 21:19:20 UTC) #6
darin (slow to review)
LGTM for everything outside of the privacy_blacklist directory. http://codereview.chromium.org/501082/diff/9003/11023 File chrome/browser/renderer_host/resource_dispatcher_host.cc (right): http://codereview.chromium.org/501082/diff/9003/11023#newcode1102 chrome/browser/renderer_host/resource_dispatcher_host.cc:1102: request_info->GetBlacklistManager(); ...
10 years, 11 months ago (2010-01-04 23:01:11 UTC) #7
Erik does not do reviews
http://codereview.chromium.org/501082/diff/4001/2010 File chrome/browser/privacy_blacklist/blacklist_listener.cc (right): http://codereview.chromium.org/501082/diff/4001/2010#newcode21 chrome/browser/privacy_blacklist/blacklist_listener.cc:21: NotificationType::BLACKLIST_MANAGER_BLACKLIST_READ_FINISHED, On 2009/12/29 08:47:10, Paweł Hajdan Jr. wrote: > ...
10 years, 11 months ago (2010-01-05 00:59:16 UTC) #8
Paweł Hajdan Jr.
http://codereview.chromium.org/501082/diff/4001/2010 File chrome/browser/privacy_blacklist/blacklist_listener.cc (right): http://codereview.chromium.org/501082/diff/4001/2010#newcode21 chrome/browser/privacy_blacklist/blacklist_listener.cc:21: NotificationType::BLACKLIST_MANAGER_BLACKLIST_READ_FINISHED, On 2010/01/05 00:59:16, Erik Kay wrote: > So ...
10 years, 11 months ago (2010-01-05 08:27:14 UTC) #9
Erik does not do reviews
LGTM, assuming no other significant changes from Darin's response to the other question http://codereview.chromium.org/501082/diff/4001/2010 File ...
10 years, 11 months ago (2010-01-05 15:29:49 UTC) #10
darin (slow to review)
10 years, 11 months ago (2010-01-05 17:20:52 UTC) #11
http://codereview.chromium.org/501082/diff/4001/2020
File chrome/browser/privacy_blacklist/blacklist_ui.cc (right):

http://codereview.chromium.org/501082/diff/4001/2020#newcode44
chrome/browser/privacy_blacklist/blacklist_ui.cc:44: RenderViewHost* view =
RenderViewHost::FromID(child_id_, route_id_);
Storing a raw pointer to RenderViewHost seems risky because we then have to
ensure that it remains valid, which could be a problem when the tab is closing. 
The current solution seems good to me.

Also note that it is not possible to lookup the RenderViewHost from the IO
thread, and the constructor of this task runs on the IO thread.

The current solution matches what we do elsewhere when sending notifications
from the IO thread to a particular RVH on the UI thread.

Powered by Google App Engine
This is Rietveld 408576698