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

Unified Diff: content/browser/frame_host/frame_tree_node.cc

Issue 2329523003: Main frame's unique name can always be null. (Closed)
Patch Set: Addressed CR feedback from dcheng@. Created 4 years, 3 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 | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree_node.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index 8af110a789dc77d5e28b7e38653f807a237a2dbb..9d6eac59956f040c18ba9478aa7efcc9d024b4c9 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -232,6 +232,15 @@ void FrameTreeNode::SetFrameName(const std::string& name,
DCHECK_EQ(unique_name, replication_state_.unique_name);
return;
}
+
+ if (parent()) {
+ // Non-main frames should have a non-empty unique name.
+ DCHECK(!unique_name.empty());
+ } else {
+ // Unique name of main frames should always stay empty.
+ DCHECK(unique_name.empty());
Charlie Reis 2016/09/15 20:04:12 This is in response to an IPC, right? Should we e
Łukasz Anforowicz 2016/09/15 20:55:13 Usually yes, but not necessarily. For example - a
+ }
+
RecordUniqueNameLength(unique_name.size());
render_manager_.OnDidUpdateName(name, unique_name);
replication_state_.name = name;
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698