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

Unified Diff: chrome/browser/ui/webui/inspect_ui.cc

Issue 2442953002: Remove stl_util's deletion function use from chrome/. (Closed)
Patch Set: fix Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/inspect_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/inspect_ui.cc
diff --git a/chrome/browser/ui/webui/inspect_ui.cc b/chrome/browser/ui/webui/inspect_ui.cc
index c457e1e27b25948741b37a5bd8394bea80e8cc84..28419a934f4e309531b5d3f456d20e2bffc3f365 100644
--- a/chrome/browser/ui/webui/inspect_ui.cc
+++ b/chrome/browser/ui/webui/inspect_ui.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/webui/inspect_ui.h"
#include "base/macros.h"
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "chrome/browser/devtools/devtools_targets_ui.h"
#include "chrome/browser/devtools/devtools_ui_bindings.h"
#include "chrome/browser/devtools/devtools_window.h"
@@ -447,7 +447,7 @@ void InspectUI::StopListeningNotifications() {
if (target_handlers_.empty())
return;
- base::STLDeleteValues(&target_handlers_);
+ target_handlers_.clear();
port_status_serializer_.reset();
@@ -534,19 +534,19 @@ const base::Value* InspectUI::GetPrefValue(const char* name) {
void InspectUI::AddTargetUIHandler(
std::unique_ptr<DevToolsTargetsUIHandler> handler) {
- DevToolsTargetsUIHandler* handler_ptr = handler.release();
- target_handlers_[handler_ptr->source_id()] = handler_ptr;
+ std::string id = handler->source_id();
+ target_handlers_[id] = std::move(handler);
}
DevToolsTargetsUIHandler* InspectUI::FindTargetHandler(
const std::string& source_id) {
- TargetHandlerMap::iterator it = target_handlers_.find(source_id);
- return it != target_handlers_.end() ? it->second : nullptr;
+ auto it = target_handlers_.find(source_id);
+ return it != target_handlers_.end() ? it->second.get() : nullptr;
}
scoped_refptr<content::DevToolsAgentHost> InspectUI::FindTarget(
const std::string& source_id, const std::string& target_id) {
- TargetHandlerMap::iterator it = target_handlers_.find(source_id);
+ auto it = target_handlers_.find(source_id);
return it != target_handlers_.end() ?
it->second->GetTarget(target_id) : nullptr;
}
« no previous file with comments | « chrome/browser/ui/webui/inspect_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698