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

Side by Side Diff: chrome/browser/renderer_host/safe_browsing_resource_throttle.h

Issue 648653003: Standardize usage of virtual/override/final in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_THROTTLE_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_THROTTLE_H_
6 #define CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_THROTTLE_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_THROTTLE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 class SafeBrowsingResourceThrottle 47 class SafeBrowsingResourceThrottle
48 : public content::ResourceThrottle, 48 : public content::ResourceThrottle,
49 public SafeBrowsingDatabaseManager::Client, 49 public SafeBrowsingDatabaseManager::Client,
50 public base::SupportsWeakPtr<SafeBrowsingResourceThrottle> { 50 public base::SupportsWeakPtr<SafeBrowsingResourceThrottle> {
51 public: 51 public:
52 SafeBrowsingResourceThrottle(const net::URLRequest* request, 52 SafeBrowsingResourceThrottle(const net::URLRequest* request,
53 content::ResourceType resource_type, 53 content::ResourceType resource_type,
54 SafeBrowsingService* safe_browsing); 54 SafeBrowsingService* safe_browsing);
55 55
56 // content::ResourceThrottle implementation (called on IO thread): 56 // content::ResourceThrottle implementation (called on IO thread):
57 virtual void WillStartRequest(bool* defer) override; 57 void WillStartRequest(bool* defer) override;
58 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) override; 58 void WillRedirectRequest(const GURL& new_url, bool* defer) override;
59 virtual const char* GetNameForLogging() const override; 59 const char* GetNameForLogging() const override;
60 60
61 // SafeBrowsingDabaseManager::Client implementation (called on IO thread): 61 // SafeBrowsingDabaseManager::Client implementation (called on IO thread):
62 virtual void OnCheckBrowseUrlResult(const GURL& url, 62 void OnCheckBrowseUrlResult(const GURL& url,
63 SBThreatType result, 63 SBThreatType result,
64 const std::string& metadata) override; 64 const std::string& metadata) override;
65 65
66 private: 66 private:
67 // Describes what phase of the check a throttle is in. 67 // Describes what phase of the check a throttle is in.
68 enum State { 68 enum State {
69 STATE_NONE, 69 STATE_NONE,
70 STATE_CHECKING_URL, 70 STATE_CHECKING_URL,
71 STATE_DISPLAYING_BLOCKING_PAGE, 71 STATE_DISPLAYING_BLOCKING_PAGE,
72 }; 72 };
73 73
74 // Describes what stage of the request got paused by the check. 74 // Describes what stage of the request got paused by the check.
75 enum DeferState { 75 enum DeferState {
76 DEFERRED_NONE, 76 DEFERRED_NONE,
77 DEFERRED_START, 77 DEFERRED_START,
78 DEFERRED_REDIRECT, 78 DEFERRED_REDIRECT,
79 }; 79 };
80 80
81 virtual ~SafeBrowsingResourceThrottle(); 81 ~SafeBrowsingResourceThrottle() override;
82 82
83 // SafeBrowsingService::UrlCheckCallback implementation. 83 // SafeBrowsingService::UrlCheckCallback implementation.
84 void OnBlockingPageComplete(bool proceed); 84 void OnBlockingPageComplete(bool proceed);
85 85
86 // Starts running |url| through the safe browsing check. Returns true if the 86 // Starts running |url| through the safe browsing check. Returns true if the
87 // URL is safe to visit. Otherwise returns false and will call 87 // URL is safe to visit. Otherwise returns false and will call
88 // OnBrowseUrlResult() when the check has completed. 88 // OnBrowseUrlResult() when the check has completed.
89 bool CheckUrl(const GURL& url); 89 bool CheckUrl(const GURL& url);
90 90
91 // Callback for when the safe browsing check (which was initiated by 91 // Callback for when the safe browsing check (which was initiated by
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 scoped_refptr<SafeBrowsingUIManager> ui_manager_; 129 scoped_refptr<SafeBrowsingUIManager> ui_manager_;
130 const net::URLRequest* request_; 130 const net::URLRequest* request_;
131 const bool is_subresource_; 131 const bool is_subresource_;
132 const bool is_subframe_; 132 const bool is_subframe_;
133 133
134 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingResourceThrottle); 134 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingResourceThrottle);
135 }; 135 };
136 136
137 137
138 #endif // CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_THROTTLE_H_ 138 #endif // CHROME_BROWSER_RENDERER_HOST_SAFE_BROWSING_RESOURCE_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698