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

Unified Diff: chrome/browser/ssl/ssl_error_handler.cc

Issue 2842833003: Update SupportsUserData uses with unique_ptr. (Closed)
Patch Set: rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ssl/ssl_error_handler.cc
diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc
index 12f5d3dccd8f92c753610be7efa4b06fc94e39d8..2bbdd3ef364c715d7112e7180d6c2da545c876c2 100644
--- a/chrome/browser/ssl/ssl_error_handler.cc
+++ b/chrome/browser/ssl/ssl_error_handler.cc
@@ -77,14 +77,16 @@ class CommonNameMismatchRedirectObserver
: public content::WebContentsObserver,
public content::WebContentsUserData<CommonNameMismatchRedirectObserver> {
public:
+ ~CommonNameMismatchRedirectObserver() override {}
+
static void AddToConsoleAfterNavigation(
content::WebContents* web_contents,
const std::string& request_url_hostname,
const std::string& suggested_url_hostname) {
web_contents->SetUserData(
UserDataKey(),
- new CommonNameMismatchRedirectObserver(
- web_contents, request_url_hostname, suggested_url_hostname));
+ base::WrapUnique(new CommonNameMismatchRedirectObserver(
+ web_contents, request_url_hostname, suggested_url_hostname)));
}
private:
@@ -95,7 +97,6 @@ class CommonNameMismatchRedirectObserver
web_contents_(web_contents),
request_url_hostname_(request_url_hostname),
suggested_url_hostname_(suggested_url_hostname) {}
- ~CommonNameMismatchRedirectObserver() override {}
// WebContentsObserver:
void NavigationStopped() override {
@@ -469,7 +470,7 @@ void SSLErrorHandler::HandleSSLError(
web_contents, ssl_info, profile, cert_error, options_mask,
request_url, std::move(ssl_cert_reporter), callback)),
web_contents, profile, cert_error, ssl_info, request_url, callback);
- web_contents->SetUserData(UserDataKey(), error_handler);
+ web_contents->SetUserData(UserDataKey(), base::WrapUnique(error_handler));
error_handler->StartHandlingError();
}
« no previous file with comments | « chrome/browser/ssl/ssl_error_handler.h ('k') | chrome/browser/supervised_user/supervised_user_interstitial.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698