diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-23 21:05:34 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-23 21:05:34 +0000 |
commit | 1b277e7f6d171b9cb2383f925373ffedcd3e4672 (patch) | |
tree | 931b42af6d84753cb1d24c1eec80e913f104c625 /chrome/browser/safe_browsing/safe_browsing_service.h | |
parent | deb17b8d4fc8ef1bc2222bbb83414d6983fd7d02 (diff) | |
download | chromium_src-1b277e7f6d171b9cb2383f925373ffedcd3e4672.zip chromium_src-1b277e7f6d171b9cb2383f925373ffedcd3e4672.tar.gz chromium_src-1b277e7f6d171b9cb2383f925373ffedcd3e4672.tar.bz2 |
This CL makes the safe browsing interstitial page support multiple unsafe resources in one page.
We had a bug when an interstitial was showing and another unsafe resource was detected. We would show another interstitial on top of the original one, causing the DontProceed method to be invoked several times. That would cause us to remove more than once an entry from the navigation controller and cause crashers.
With this new CL, if an interstitial shows and a new resource is flagged as bad, the SafeBrowsingBlockingPage will queue that notification. If the user decides to proceed through the interstitial, we'll create another interstitial warning about all the unsafe resources we have received so far.
This CL also contains a fix for a crasher that would happen when closing a tab with a safe browsing interstitial.
BUG=5916,6207,6306
TEST=Test all actions in the interstitial you get when opening pages with the followin scenarios:
- Main page is malware
- Main page is fishing
- Main page is OK contains resources (images,iframes...) which are malware
- Main page is OK contains resources (images,iframes...) which are phishing
- Main page is OK contains resources (images,iframes...) some of them phishing, some of then malware.
Note that when there are more than one bad resource, it is normal to see a 1st interstitial, then another one listing all the other bad resources.
(ex of malware site http://ianfette.org, phishing site http://cvisit.tripod.com)
Review URL: http://codereview.chromium.org/18346
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8578 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/safe_browsing_service.h')
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_service.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h index 1d5f229..0917ec9 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.h +++ b/chrome/browser/safe_browsing/safe_browsing_service.h @@ -57,14 +57,13 @@ class SafeBrowsingService // Structure used to pass parameters between the IO and UI thread when // interacting with the blocking page. - struct BlockingPageParam { + struct UnsafeResource { GURL url; - bool proceed; - UrlCheckResult result; + ResourceType::Type resource_type; + UrlCheckResult threat_type; Client* client; int render_process_host_id; int render_view_id; - ResourceType::Type resource_type; }; // Creates the safe browsing service. Need to initialize before using. @@ -142,7 +141,8 @@ class SafeBrowsingService void UpdateFinished(bool update_succeeded); // The blocking page on the UI thread has completed. - void OnBlockingPageDone(const BlockingPageParam& param); + void OnBlockingPageDone(const std::vector<UnsafeResource>& resources, + bool proceed); // Called when the SafeBrowsingProtocolManager has received updated MAC keys. void OnNewMacKeys(const std::string& client_key, @@ -242,7 +242,7 @@ class SafeBrowsingService void HandleResume(); // Invoked on the UI thread to show the blocking page. - void DoDisplayBlockingPage(const BlockingPageParam& param); + void DoDisplayBlockingPage(const UnsafeResource& resource); // During a reset or the initial load we may have to queue checks until the // database is ready. This method is run once the database has loaded (or if |