summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/safe_browsing_service.h
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-13 22:42:47 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-13 22:42:47 +0000
commitcbab76d1c74c93837bc76298d1a2e43646154194 (patch)
tree7f1bdcd891e670b67eeac2993730c580698048eb /chrome/browser/safe_browsing/safe_browsing_service.h
parent3c1e4d080a8e69fb973638d1360d4d5dd0d2e4d5 (diff)
downloadchromium_src-cbab76d1c74c93837bc76298d1a2e43646154194.zip
chromium_src-cbab76d1c74c93837bc76298d1a2e43646154194.tar.gz
chromium_src-cbab76d1c74c93837bc76298d1a2e43646154194.tar.bz2
This is the first pass at refactoring the interstitial page.
The SSL and malware blocking pages were doing similar things in 2 different classes. There is now a base class called InterstitialPage that contains the common logic. As part of that refactoring, the safe browsing was changed so that the SafeBrowsingBlockingPage is only used from the UI thread. This CL also adds transient entries to the navigation controller: that type of entry gets deleted as soon as a navigation occurs. It is used by interstitial that need to create such a temporary entry while they show. BUG=3013 TEST=Run the unit tests and ui tests. Review URL: http://codereview.chromium.org/6311 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3324 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.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h
index 1d25d53..aec465d 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -52,6 +52,18 @@ class SafeBrowsingService
virtual void OnBlockingPageComplete(bool proceed) = 0;
};
+ // Structure used to pass parameters between the IO and UI thread when
+ // interacting with the blocking page.
+ struct BlockingPageParam {
+ GURL url;
+ bool proceed;
+ UrlCheckResult result;
+ 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.
SafeBrowsingService();
~SafeBrowsingService();
@@ -125,9 +137,7 @@ class SafeBrowsingService
void UpdateFinished();
// The blocking page on the UI thread has completed.
- void OnBlockingPageDone(SafeBrowsingBlockingPage* page,
- Client* client,
- bool proceed);
+ void OnBlockingPageDone(const BlockingPageParam& param);
// Called when the SafeBrowsingProtocolManager has received updated MAC keys.
void OnNewMacKeys(const std::string& client_key,
@@ -216,6 +226,9 @@ class SafeBrowsingService
// power state.
void HandleResume();
+ // Invoked on the UI thread to show the blocking page.
+ void DoDisplayBlockingPage(const BlockingPageParam& param);
+
MessageLoop* io_loop_;
typedef std::set<SafeBrowsingCheck*> CurrentChecks;