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

Unified Diff: content/browser/ssl/ssl_manager.cc

Issue 2815913005: Switch to using scoped_ptr with UserData (Closed)
Patch Set: fixes 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: content/browser/ssl/ssl_manager.cc
diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
index 650bfeb348cf486d3d911050be0a1c9a9050c171..2a3124acae247b38d959156da59540dc80a6a42e 100644
--- a/content/browser/ssl/ssl_manager.cc
+++ b/content/browser/ssl/ssl_manager.cc
@@ -5,9 +5,11 @@
#include "content/browser/ssl/ssl_manager.h"
#include <set>
+#include <utility>
#include "base/bind.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/supports_user_data.h"
@@ -173,8 +175,10 @@ SSLManager::SSLManager(NavigationControllerImpl* controller)
SSLManagerSet* managers = static_cast<SSLManagerSet*>(
controller_->GetBrowserContext()->GetUserData(kSSLManagerKeyName));
if (!managers) {
- managers = new SSLManagerSet;
- controller_->GetBrowserContext()->SetUserData(kSSLManagerKeyName, managers);
+ auto managers_owned = base::MakeUnique<SSLManagerSet>();
+ managers = managers_owned.get();
+ controller_->GetBrowserContext()->SetUserData(kSSLManagerKeyName,
+ std::move(managers_owned));
}
managers->get().insert(this);
}

Powered by Google App Engine
This is Rietveld 408576698