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

Issue 2700323002: Refactor BaseBlockingPage to reduce duplicated code (Closed)

Created:
3 years, 10 months ago by Nate Fischer
Modified:
3 years, 10 months ago
CC:
chromium-reviews, grt+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor BaseBlockingPage to reduce duplicated code Duplicated code handling ReportDetails is moved out of CreateControllerClient() into a static method in the base class (GetReportingInfo). CreateControllerClient now uses the |ui_manager| directly, reducing the number of arguments it requires and reducing clutter when constructing the blocking pages. Chrome-only subresource checks at the end of OnProceed() have been moved into a new method (HandleSubresourcesAfterProceed). This is empty in the base class, since the base class ignores this case. The base class OnProceed() method now calls FinishThreatDetails() like chrome requires. This is to be consistent with the other FinishThreatDetails() calls we kept in the base class. If the base class ever really implements this, then we would also want to call it for OnProceed. This method is currently a NOOP, so this presents no change in behavior. Along with this change, |threat_details_proceed_delay_ms_| has been componentized as well, moved to private, and a test-only setter has been added. Because of these changes, Chrome now uses the component layer OnProceed method. ShowBlockingPage() is restructured to be more readable. No change beyond that, since I couldn't think of a clean way to reduce code duplication. Lastly, unnecessary includes have been removed. BUG= Review-Url: https://codereview.chromium.org/2700323002 Cr-Commit-Position: refs/heads/master@{#452717} Committed: https://chromium.googlesource.com/chromium/src/+/fef42f9a072d257f7f4ef0300ea172f45754167a

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -121 lines) Patch
M chrome/browser/safe_browsing/safe_browsing_blocking_page.h View 5 chunks +6 lines, -10 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page.cc View 7 chunks +27 lines, -61 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/ui_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/safe_browsing/base_blocking_page.h View 3 chunks +17 lines, -7 lines 0 comments Download
M components/safe_browsing/base_blocking_page.cc View 5 chunks +65 lines, -40 lines 0 comments Download

Messages

Total messages: 19 (10 generated)
Nate Fischer
PTAL. This is a follow-up to our initial componentization, since I felt we could do ...
3 years, 10 months ago (2017-02-21 20:12:33 UTC) #6
Nate Fischer
On 2017/02/21 at 20:12:33, Nate Fischer wrote: > PTAL. This is a follow-up to our ...
3 years, 10 months ago (2017-02-23 21:04:17 UTC) #7
Nate Fischer
On 2017/02/23 at 21:04:17, Nate Fischer wrote: > On 2017/02/21 at 20:12:33, Nate Fischer wrote: ...
3 years, 10 months ago (2017-02-23 22:46:14 UTC) #9
Jialiu Lin
Sure, I'll send you feedback by the end of today.
3 years, 10 months ago (2017-02-23 23:07:26 UTC) #10
Nate Fischer
On 2017/02/23 at 23:07:26, jialiul wrote: > Sure, I'll send you feedback by the end ...
3 years, 10 months ago (2017-02-23 23:08:06 UTC) #11
Jialiu Lin
lgtm. Much cleaner now. Thanks for cleaning up these files!
3 years, 10 months ago (2017-02-24 00:07:00 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2700323002/1
3 years, 10 months ago (2017-02-24 00:55:50 UTC) #14
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/fef42f9a072d257f7f4ef0300ea172f45754167a
3 years, 10 months ago (2017-02-24 02:16:27 UTC) #17
vakh (use Gerrit instead)
3 years, 10 months ago (2017-02-25 00:44:43 UTC) #19
Message was sent while issue was closed.
I'm sorry I totally missed this.

Powered by Google App Engine
This is Rietveld 408576698