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

Unified Diff: extensions/browser/declarative_user_script_manager.cc

Issue 2294653002: Some linked_ptr -> unique_ptr conversion in extensions/browser. (Closed)
Patch Set: address comments Created 4 years, 4 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
« no previous file with comments | « extensions/browser/declarative_user_script_manager.h ('k') | extensions/browser/event_listener_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/declarative_user_script_manager.cc
diff --git a/extensions/browser/declarative_user_script_manager.cc b/extensions/browser/declarative_user_script_manager.cc
index 9c10ab3f2f220ac99806608383a43d3e47ddf11a..9443c8f357bd50765db0fbdfa4ec6acbfec5b69b 100644
--- a/extensions/browser/declarative_user_script_manager.cc
+++ b/extensions/browser/declarative_user_script_manager.cc
@@ -4,6 +4,7 @@
#include "extensions/browser/declarative_user_script_manager.h"
+#include "base/memory/ptr_util.h"
#include "content/public/browser/browser_context.h"
#include "extensions/browser/declarative_user_script_manager_factory.h"
#include "extensions/browser/declarative_user_script_master.h"
@@ -42,10 +43,12 @@ DeclarativeUserScriptManager::GetDeclarativeUserScriptMasterByID(
DeclarativeUserScriptMaster*
DeclarativeUserScriptManager::CreateDeclarativeUserScriptMaster(
const HostID& host_id) {
- linked_ptr<DeclarativeUserScriptMaster> master(
- new DeclarativeUserScriptMaster(browser_context_, host_id));
- declarative_user_script_masters_[host_id] = master;
- return master.get();
+ // Inserts a new DeclarativeUserScriptManager and returns a ptr to it.
+ return declarative_user_script_masters_
+ .insert(
+ std::make_pair(host_id, base::MakeUnique<DeclarativeUserScriptMaster>(
+ browser_context_, host_id)))
+ .first->second.get();
}
void DeclarativeUserScriptManager::OnExtensionUnloaded(
« no previous file with comments | « extensions/browser/declarative_user_script_manager.h ('k') | extensions/browser/event_listener_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698