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

Unified Diff: content/browser/webui/url_data_manager.cc

Issue 2815913005: Switch to using scoped_ptr with UserData (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: content/browser/webui/url_data_manager.cc
diff --git a/content/browser/webui/url_data_manager.cc b/content/browser/webui/url_data_manager.cc
index 0a482ad8ae00ea890634668dfe676ebc7375e76f..5681ff549fd49075b11c7b1add1fe2196f3ac308 100644
--- a/content/browser/webui/url_data_manager.cc
+++ b/content/browser/webui/url_data_manager.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/lazy_instance.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted_memory.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
@@ -32,7 +33,8 @@ base::LazyInstance<base::Lock>::Leaky g_delete_lock = LAZY_INSTANCE_INITIALIZER;
URLDataManager* GetFromBrowserContext(BrowserContext* context) {
if (!context->GetUserData(kURLDataManagerKeyName)) {
- context->SetUserData(kURLDataManagerKeyName, new URLDataManager(context));
+ context->SetUserData(kURLDataManagerKeyName,
+ base::MakeUnique<URLDataManager>(context));
}
return static_cast<URLDataManager*>(
context->GetUserData(kURLDataManagerKeyName));
« no previous file with comments | « content/browser/websockets/websocket_handshake_request_info_impl.cc ('k') | content/common/net/url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698