diff options
author | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-19 20:01:00 +0000 |
---|---|---|
committer | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-19 20:01:00 +0000 |
commit | 3ead1329dfad20de066dc5882df63b4ccc851608 (patch) | |
tree | b6d961150ff52d1b2afe888ad42e524209693cb0 /chrome/renderer/render_thread.h | |
parent | d843cd31b00d652198d49b099074db6db940833d (diff) | |
download | chromium_src-3ead1329dfad20de066dc5882df63b4ccc851608.zip chromium_src-3ead1329dfad20de066dc5882df63b4ccc851608.tar.gz chromium_src-3ead1329dfad20de066dc5882df63b4ccc851608.tar.bz2 |
Have the RenderThread initialize a PhishingClassifier when it receives a
ViewMsg_SetPhishingModel message from the browser, and run it after pages
load in the renderer. The phishing classifier will only run on new
navigations where the toplevel URL has changed. Since we need to keep the page text around in memory in the case where the model is not yet set when a page loads, this is also conditional on a command-line flag.
The next steps will be to send the SetPhishingModel IPC from the browser, finish implementing the DetectedPhishingSite IPC, and ping to confirm the phishy verdict.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3615003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_thread.h')
-rw-r--r-- | chrome/renderer/render_thread.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h index 86fab60..bdba97e 100644 --- a/chrome/renderer/render_thread.h +++ b/chrome/renderer/render_thread.h @@ -50,6 +50,7 @@ struct WebPreferences; namespace base { class MessageLoopProxy; +template<class T> class ScopedCallbackFactory; class Thread; } @@ -57,6 +58,10 @@ namespace IPC { struct ChannelHandle; } +namespace safe_browsing { +class Scorer; +} + namespace WebKit { class WebStorageEventDispatcher; } @@ -189,6 +194,12 @@ class RenderThread : public RenderThreadBase, return spellchecker_.get(); } + // Returns the phishing Scorer object, or NULL if a model has not been passed + // in from the browser yet. + const safe_browsing::Scorer* phishing_scorer() const { + return phishing_scorer_.get(); + } + bool plugin_refresh_allowed() const { return plugin_refresh_allowed_; } // Do DNS prefetch resolution of a hostname. @@ -326,8 +337,12 @@ class RenderThread : public RenderThreadBase, // it is allowed to run on. void RegisterExtension(v8::Extension* extension, bool restrict_to_extensions); + // Callback to be run once the phishing Scorer has been created. + void PhishingScorerCreated(safe_browsing::Scorer* scorer); + // These objects live solely on the render thread. scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > task_factory_; + scoped_ptr<base::ScopedCallbackFactory<RenderThread> > callback_factory_; scoped_ptr<VisitedLinkSlave> visited_link_slave_; scoped_ptr<UserScriptSlave> user_script_slave_; scoped_ptr<RendererNetPredictor> renderer_net_predictor_; @@ -339,6 +354,7 @@ class RenderThread : public RenderThreadBase, scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; scoped_ptr<SpellCheck> spellchecker_; + scoped_ptr<const safe_browsing::Scorer> phishing_scorer_; // Used on the renderer and IPC threads. scoped_refptr<DBMessageFilter> db_message_filter_; |