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

Unified Diff: ash/devtools/ash_devtools_dom_agent.cc

Issue 2903173002: Closing simulation window in chromeos sessions causes crash. (Closed)
Patch Set: use std::unique_ptr for window_element_root_. Created 3 years, 7 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 | « ash/devtools/ash_devtools_dom_agent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/devtools/ash_devtools_dom_agent.cc
diff --git a/ash/devtools/ash_devtools_dom_agent.cc b/ash/devtools/ash_devtools_dom_agent.cc
index 24cac7f5ed0a1044d6839c703690e0e2a9ae3560..3a6831a8e2e25ea8073ea354302fe3a99dd1cda3 100644
--- a/ash/devtools/ash_devtools_dom_agent.cc
+++ b/ash/devtools/ash_devtools_dom_agent.cc
@@ -221,11 +221,12 @@ AshDevToolsDOMAgent::BuildInitialTree() {
// TODO(thanhph): Root of UIElement tree shoudn't be WindowElement
// but maybe a new different element type.
- window_element_root_ = new WindowElement(nullptr, this, nullptr);
+ window_element_root_ =
+ base::MakeUnique<WindowElement>(nullptr, this, nullptr);
for (aura::Window* window : Shell::GetAllRootWindows()) {
UIElement* window_element =
- new WindowElement(window, this, window_element_root_);
+ new WindowElement(window, this, window_element_root_.get());
children->addItem(BuildTreeForUIElement(window_element));
window_element_root_->AddChild(window_element);
@@ -323,7 +324,7 @@ void AshDevToolsDOMAgent::RemoveDomNode(UIElement* ui_element) {
void AshDevToolsDOMAgent::Reset() {
is_building_tree_ = false;
widget_for_highlighting_.reset();
- delete window_element_root_;
+ window_element_root_.reset();
node_id_to_ui_element_.clear();
observers_.Clear();
}
« no previous file with comments | « ash/devtools/ash_devtools_dom_agent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698