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

Unified Diff: ash/common/devtools/ash_devtools_css_agent.cc

Issue 2524863004: Fix bug where CSS styles are requested after node is destroyed (Closed)
Patch Set: sadruls comments Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/devtools/ash_devtools_css_agent.cc
diff --git a/ash/common/devtools/ash_devtools_css_agent.cc b/ash/common/devtools/ash_devtools_css_agent.cc
index 295b53a3b35307921173814b2b0cca68196a8fe4..ac41162ca2fdb5ce4e0b2bae39ec7289da7a40df 100644
--- a/ash/common/devtools/ash_devtools_css_agent.cc
+++ b/ash/common/devtools/ash_devtools_css_agent.cc
@@ -64,28 +64,31 @@ AshDevToolsCSSAgent::AshDevToolsCSSAgent(AshDevToolsDOMAgent* dom_agent)
AshDevToolsCSSAgent::~AshDevToolsCSSAgent() {}
ui::devtools::protocol::Response AshDevToolsCSSAgent::getMatchedStylesForNode(
- int nodeId,
+ int node_id,
ui::devtools::protocol::Maybe<ui::devtools::protocol::CSS::CSSStyle>*
inlineStyle) {
- *inlineStyle = GetStylesForNode(nodeId);
+ *inlineStyle = GetStylesForNode(node_id);
+ if (!inlineStyle) {
+ return ui::devtools::protocol::Response::Error(
+ "Node with that id not found");
+ }
return ui::devtools::protocol::Response::OK();
}
std::unique_ptr<ui::devtools::protocol::CSS::CSSStyle>
-AshDevToolsCSSAgent::GetStylesForNode(int nodeId) {
- WmWindow* window = dom_agent_->GetWindowFromNodeId(nodeId);
+AshDevToolsCSSAgent::GetStylesForNode(int node_id) {
+ WmWindow* window = dom_agent_->GetWindowFromNodeId(node_id);
if (window)
return BuildStyles(window);
- views::Widget* widget = dom_agent_->GetWidgetFromNodeId(nodeId);
+ views::Widget* widget = dom_agent_->GetWidgetFromNodeId(node_id);
if (widget)
return BuildStyles(widget);
- views::View* view = dom_agent_->GetViewFromNodeId(nodeId);
+ views::View* view = dom_agent_->GetViewFromNodeId(node_id);
if (view)
return BuildStyles(view);
- NOTREACHED();
return nullptr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698