diff options
14 files changed, 76 insertions, 65 deletions
diff --git a/chrome/browser/download/download_safe_browsing_client.h b/chrome/browser/download/download_safe_browsing_client.h index a6d0712..5aa44b5 100644 --- a/chrome/browser/download/download_safe_browsing_client.h +++ b/chrome/browser/download/download_safe_browsing_client.h @@ -54,9 +54,10 @@ class DownloadSBClient // Callback interfaces for SafeBrowsingService::Client. virtual void OnDownloadUrlCheckResult( const std::vector<GURL>& url_chain, - SafeBrowsingService::UrlCheckResult result); + SafeBrowsingService::UrlCheckResult result) OVERRIDE; virtual void OnDownloadHashCheckResult( - const std::string& hash, SafeBrowsingService::UrlCheckResult result); + const std::string& hash, + SafeBrowsingService::UrlCheckResult result) OVERRIDE; // Enumerate for histogramming purposes. // DO NOT CHANGE THE ORDERING OF THESE VALUES (different histogram data will diff --git a/chrome/browser/renderer_host/safe_browsing_resource_handler.h b/chrome/browser/renderer_host/safe_browsing_resource_handler.h index c1a8587..bc5bdf9 100644 --- a/chrome/browser/renderer_host/safe_browsing_resource_handler.h +++ b/chrome/browser/renderer_host/safe_browsing_resource_handler.h @@ -51,27 +51,32 @@ class SafeBrowsingResourceHandler : public ResourceHandler, ResourceDispatcherHost* resource_dispatcher_host); // ResourceHandler implementation: - virtual bool OnUploadProgress(int request_id, uint64 position, uint64 size); - virtual bool OnRequestRedirected(int request_id, const GURL& new_url, - ResourceResponse* response, bool* defer); - virtual bool OnResponseStarted(int request_id, ResourceResponse* response); - virtual bool OnWillStart(int request_id, const GURL& url, bool* defer); - virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, - int min_size); - virtual bool OnReadCompleted(int request_id, int* bytes_read); + virtual bool OnUploadProgress( + int request_id, uint64 position, uint64 size) OVERRIDE; + virtual bool OnRequestRedirected( + int request_id, const GURL& new_url, ResourceResponse* response, + bool* defer) OVERRIDE; + virtual bool OnResponseStarted( + int request_id, ResourceResponse* response) OVERRIDE; + virtual bool OnWillStart( + int request_id, const GURL& url, bool* defer) OVERRIDE; + virtual bool OnWillRead( + int request_id, net::IOBuffer** buf, int* buf_size, + int min_size) OVERRIDE; + virtual bool OnReadCompleted(int request_id, int* bytes_read) OVERRIDE; virtual bool OnResponseCompleted(int request_id, const net::URLRequestStatus& status, - const std::string& security_info); - virtual void OnRequestClosed(); + const std::string& security_info) OVERRIDE; + virtual void OnRequestClosed() OVERRIDE; // SafeBrowsingService::Client implementation, called on the IO thread once // the URL has been classified. virtual void OnBrowseUrlCheckResult( - const GURL& url, SafeBrowsingService::UrlCheckResult result); + const GURL& url, SafeBrowsingService::UrlCheckResult result) OVERRIDE; // SafeBrowsingService::Client implementation, called on the IO thread when // the user has decided to proceed with the current request, or go back. - virtual void OnBlockingPageComplete(bool proceed); + virtual void OnBlockingPageComplete(bool proceed) OVERRIDE; private: // Describes what phase of the check a handler is in. diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc index 146af77..2224d7c 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host.cc @@ -242,7 +242,7 @@ class CsdClient : public SafeBrowsingService::Client { // Method from SafeBrowsingService::Client. This method is called on the // IO thread once the interstitial is going away. This method simply deletes // the CsdClient object. - virtual void OnBlockingPageComplete(bool proceed) { + virtual void OnBlockingPageComplete(bool proceed) OVERRIDE { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // Delete this on the UI thread since it was created there. BrowserThread::PostTask(BrowserThread::UI, diff --git a/chrome/browser/safe_browsing/client_side_detection_host.h b/chrome/browser/safe_browsing/client_side_detection_host.h index 1d0b15e..ba9af18 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host.h +++ b/chrome/browser/safe_browsing/client_side_detection_host.h @@ -40,23 +40,23 @@ class ClientSideDetectionHost : public TabContentsObserver, virtual ~ClientSideDetectionHost(); // From TabContentsObserver. - virtual bool OnMessageReceived(const IPC::Message& message); + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; // From TabContentsObserver. If we navigate away we cancel all pending // callbacks that could show an interstitial, and check to see whether // we should classify the new URL. virtual void DidNavigateMainFramePostCommit( const content::LoadCommittedDetails& details, - const ViewHostMsg_FrameNavigate_Params& params); + const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; // Called when the SafeBrowsingService found a hit with one of the // SafeBrowsing lists. This method is called on the UI thread. virtual void OnSafeBrowsingHit( - const SafeBrowsingService::UnsafeResource& resource); + const SafeBrowsingService::UnsafeResource& resource) OVERRIDE; protected: // From TabContentsObserver. Called when the TabContents is being destroyed. - virtual void TabContentsDestroyed(TabContents* tab); + virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; private: friend class ClientSideDetectionHostTest; @@ -82,7 +82,7 @@ class ClientSideDetectionHost : public TabContentsObserver, // method is called in the UI thread. virtual void Observe(int type, const NotificationSource& source, - const NotificationDetails& details); + const NotificationDetails& details) OVERRIDE; // Returns true if the user has seen a regular SafeBrowsing // interstitial for the current page. This is only true if the user has diff --git a/chrome/browser/safe_browsing/client_side_detection_service.h b/chrome/browser/safe_browsing/client_side_detection_service.h index 3fb5e49..d2a2f33 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.h +++ b/chrome/browser/safe_browsing/client_side_detection_service.h @@ -71,12 +71,12 @@ class ClientSideDetectionService : public URLFetcher::Delegate, const net::URLRequestStatus& status, int response_code, const net::ResponseCookies& cookies, - const std::string& data); + const std::string& data) OVERRIDE; // NotificationObserver overrides: virtual void Observe(int type, const NotificationSource& source, - const NotificationDetails& details); + const NotificationDetails& details) OVERRIDE; // Sends a request to the SafeBrowsing servers with the ClientPhishingRequest. // The URL scheme of the |url()| in the request should be HTTP. This method diff --git a/chrome/browser/safe_browsing/malware_details.h b/chrome/browser/safe_browsing/malware_details.h index 473eab8..d4036c6 100644 --- a/chrome/browser/safe_browsing/malware_details.h +++ b/chrome/browser/safe_browsing/malware_details.h @@ -66,7 +66,7 @@ class MalwareDetails : public base::RefCountedThreadSafe<MalwareDetails>, void OnRedirectionCollectionReady(); // TabContentsObserver implementation. - virtual bool OnMessageReceived(const IPC::Message& message); + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; protected: friend class MalwareDetailsFactoryImpl; diff --git a/chrome/browser/safe_browsing/malware_details_cache.h b/chrome/browser/safe_browsing/malware_details_cache.h index 87b65c4..115eb1a 100644 --- a/chrome/browser/safe_browsing/malware_details_cache.h +++ b/chrome/browser/safe_browsing/malware_details_cache.h @@ -61,7 +61,7 @@ class MalwareDetailsCacheCollector const net::URLRequestStatus& status, int response_code, const net::ResponseCookies& cookies, - const std::string& data); + const std::string& data) OVERRIDE; private: // Points to the url for which we are fetching the HTTP cache entry or diff --git a/chrome/browser/safe_browsing/malware_details_history.h b/chrome/browser/safe_browsing/malware_details_history.h index 05523af..74d03fa 100644 --- a/chrome/browser/safe_browsing/malware_details_history.h +++ b/chrome/browser/safe_browsing/malware_details_history.h @@ -83,7 +83,7 @@ class MalwareDetailsRedirectsCollector virtual void Observe(int type, const NotificationSource& source, - const NotificationDetails& details); + const NotificationDetails& details) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(MalwareDetailsRedirectsCollector); }; diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h index bab7baa..98b2b1e 100644 --- a/chrome/browser/safe_browsing/protocol_manager.h +++ b/chrome/browser/safe_browsing/protocol_manager.h @@ -108,7 +108,7 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate { const net::URLRequestStatus& status, int response_code, const net::ResponseCookies& cookies, - const std::string& data); + const std::string& data) OVERRIDE; // API used by the SafeBrowsingService for issuing queries. When the results // are available, SafeBrowsingService::HandleGetHashResults is called. diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h index c10ea86..0fdea90 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h @@ -68,16 +68,17 @@ class SafeBrowsingBlockingPage : public ChromeInterstitialPage { } // ChromeInterstitialPage method: - virtual std::string GetHTMLContents(); - virtual void SetReportingPreference(bool report); - virtual void Proceed(); - virtual void DontProceed(); + virtual std::string GetHTMLContents() OVERRIDE; + virtual void Proceed() OVERRIDE; + virtual void DontProceed() OVERRIDE; protected: friend class SafeBrowsingBlockingPageTest; // ChromeInterstitialPage method: - virtual void CommandReceived(const std::string& command); + virtual void CommandReceived(const std::string& command) OVERRIDE; + + void SetReportingPreference(bool report); // Don't instanciate this class directly, use ShowBlockingPage instead. SafeBrowsingBlockingPage(SafeBrowsingService* service, @@ -91,6 +92,8 @@ class SafeBrowsingBlockingPage : public ChromeInterstitialPage { int64 malware_details_proceed_delay_ms_; private: + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, MalwareReports); + enum BlockingPageEvent { SHOW, PROCEED, diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.h b/chrome/browser/safe_browsing/safe_browsing_store_file.h index 6061cd2..f5fb81a 100644 --- a/chrome/browser/safe_browsing/safe_browsing_store_file.h +++ b/chrome/browser/safe_browsing/safe_browsing_store_file.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -110,46 +110,48 @@ class SafeBrowsingStoreFile : public SafeBrowsingStore { virtual ~SafeBrowsingStoreFile(); virtual void Init(const FilePath& filename, - Callback0::Type* corruption_callback); + Callback0::Type* corruption_callback) OVERRIDE; // Delete any on-disk files, including the permanent storage. - virtual bool Delete(); + virtual bool Delete() OVERRIDE; // Get all add hash prefixes and full-length hashes, respectively, from // the store. - virtual bool GetAddPrefixes(std::vector<SBAddPrefix>* add_prefixes); - virtual bool GetAddFullHashes(std::vector<SBAddFullHash>* add_full_hashes); + virtual bool GetAddPrefixes(std::vector<SBAddPrefix>* add_prefixes) OVERRIDE; + virtual bool GetAddFullHashes( + std::vector<SBAddFullHash>* add_full_hashes) OVERRIDE; - virtual bool BeginChunk(); + virtual bool BeginChunk() OVERRIDE; - virtual bool WriteAddPrefix(int32 chunk_id, SBPrefix prefix); + virtual bool WriteAddPrefix(int32 chunk_id, SBPrefix prefix) OVERRIDE; virtual bool WriteAddHash(int32 chunk_id, base::Time receive_time, - const SBFullHash& full_hash); + const SBFullHash& full_hash) OVERRIDE; virtual bool WriteSubPrefix(int32 chunk_id, int32 add_chunk_id, SBPrefix prefix); virtual bool WriteSubHash(int32 chunk_id, int32 add_chunk_id, - const SBFullHash& full_hash); - virtual bool FinishChunk(); + const SBFullHash& full_hash) OVERRIDE; + virtual bool FinishChunk() OVERRIDE; - virtual bool BeginUpdate(); + virtual bool BeginUpdate() OVERRIDE; // Store updates with pending add full hashes in file store and // return |add_prefixes_result| and |add_full_hashes_result|. - virtual bool FinishUpdate(const std::vector<SBAddFullHash>& pending_adds, - const std::set<SBPrefix>& prefix_misses, - std::vector<SBAddPrefix>* add_prefixes_result, - std::vector<SBAddFullHash>* add_full_hashes_result); - virtual bool CancelUpdate(); - - virtual void SetAddChunk(int32 chunk_id); - virtual bool CheckAddChunk(int32 chunk_id); - virtual void GetAddChunks(std::vector<int32>* out); - virtual void SetSubChunk(int32 chunk_id); - virtual bool CheckSubChunk(int32 chunk_id); - virtual void GetSubChunks(std::vector<int32>* out); - - virtual void DeleteAddChunk(int32 chunk_id); - virtual void DeleteSubChunk(int32 chunk_id); + virtual bool FinishUpdate( + const std::vector<SBAddFullHash>& pending_adds, + const std::set<SBPrefix>& prefix_misses, + std::vector<SBAddPrefix>* add_prefixes_result, + std::vector<SBAddFullHash>* add_full_hashes_result) OVERRIDE; + virtual bool CancelUpdate() OVERRIDE; + + virtual void SetAddChunk(int32 chunk_id) OVERRIDE; + virtual bool CheckAddChunk(int32 chunk_id) OVERRIDE; + virtual void GetAddChunks(std::vector<int32>* out) OVERRIDE; + virtual void SetSubChunk(int32 chunk_id) OVERRIDE; + virtual bool CheckSubChunk(int32 chunk_id) OVERRIDE; + virtual void GetSubChunks(std::vector<int32>* out) OVERRIDE; + + virtual void DeleteAddChunk(int32 chunk_id) OVERRIDE; + virtual void DeleteSubChunk(int32 chunk_id) OVERRIDE; // Returns the name of the temporary file used to buffer data for // |filename|. Exported for unit tests. diff --git a/chrome/renderer/safe_browsing/malware_dom_details.h b/chrome/renderer/safe_browsing/malware_dom_details.h index 5cb483a..6698aff 100644 --- a/chrome/renderer/safe_browsing/malware_dom_details.h +++ b/chrome/renderer/safe_browsing/malware_dom_details.h @@ -51,7 +51,7 @@ class MalwareDOMDetails : public RenderViewObserver { explicit MalwareDOMDetails(RenderView* render_view); // RenderViewObserver implementation. - virtual bool OnMessageReceived(const IPC::Message& message); + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; void OnGetMalwareDOMDetails(); diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate.h b/chrome/renderer/safe_browsing/phishing_classifier_delegate.h index 88b638d..77a0397 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier_delegate.h +++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate.h @@ -25,7 +25,7 @@ class PhishingClassifierFilter : public RenderProcessObserver { static PhishingClassifierFilter* Create(); virtual ~PhishingClassifierFilter(); - virtual bool OnControlMessageReceived(const IPC::Message& message); + virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; private: PhishingClassifierFilter(); @@ -61,7 +61,7 @@ class PhishingClassifierDelegate : public RenderViewObserver { // cancelled. However, if the navigation is within the same page, we // continue running the current classification. virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, - bool is_new_navigation); + bool is_new_navigation) OVERRIDE; private: friend class PhishingClassifierDelegateTest; @@ -82,7 +82,7 @@ class PhishingClassifierDelegate : public RenderViewObserver { void CancelPendingClassification(CancelClassificationReason reason); // RenderViewObserver implementation. - virtual bool OnMessageReceived(const IPC::Message& message); + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; // Called by the RenderView when it receives a StartPhishingDetection IPC // from the browser. This signals that it is ok to begin classification diff --git a/chrome/renderer/safe_browsing/render_view_fake_resources_test.h b/chrome/renderer/safe_browsing/render_view_fake_resources_test.h index ec4fd60..c3a9767 100644 --- a/chrome/renderer/safe_browsing/render_view_fake_resources_test.h +++ b/chrome/renderer/safe_browsing/render_view_fake_resources_test.h @@ -73,10 +73,10 @@ class RenderViewFakeResourcesTest : public ::testing::Test, public RenderViewVisitor { public: // IPC::Channel::Listener implementation. - virtual bool OnMessageReceived(const IPC::Message& message); + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; // RenderViewVisitor implementation. - virtual bool Visit(RenderView* render_view); + virtual bool Visit(RenderView* render_view) OVERRIDE; protected: RenderViewFakeResourcesTest(); @@ -84,8 +84,8 @@ class RenderViewFakeResourcesTest : public ::testing::Test, // Call the base class SetUp and TearDown methods as part of your // test fixture's SetUp / TearDown. - virtual void SetUp(); - virtual void TearDown(); + virtual void SetUp() OVERRIDE; + virtual void TearDown() OVERRIDE; // Loads |url| into the RenderView, waiting for the load to finish. // Before loading the url, add any content that you want to return |