| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/navigation_entry_impl.h" | 5 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 std::map<std::string, bool> names; | 869 std::map<std::string, bool> names; |
| 870 NavigationEntryImpl::TreeNode* tree_node = FindFrameEntry(frame_tree_node); | 870 NavigationEntryImpl::TreeNode* tree_node = FindFrameEntry(frame_tree_node); |
| 871 if (tree_node) { | 871 if (tree_node) { |
| 872 // Return the names of all immediate children. | 872 // Return the names of all immediate children. |
| 873 for (TreeNode* child : tree_node->children) { | 873 for (TreeNode* child : tree_node->children) { |
| 874 // Keep track of whether we would be loading about:blank, since the | 874 // Keep track of whether we would be loading about:blank, since the |
| 875 // renderer should be allowed to just commit the initial blank frame if | 875 // renderer should be allowed to just commit the initial blank frame if |
| 876 // that was the default URL. PageState doesn't matter there, because | 876 // that was the default URL. PageState doesn't matter there, because |
| 877 // content injected into about:blank frames doesn't use it. | 877 // content injected into about:blank frames doesn't use it. |
| 878 // | 878 // |
| 879 // Be careful not to include iframe srcdoc URLs in this check, which do | 879 // Be careful not to rely on FrameNavigationEntry's URLs in this check, |
| 880 // need their PageState. The committed URL in that case gets rewritten to | 880 // because the committed URL in the browser could be rewritten to |
| 881 // about:blank, but we can detect it via the PageState's URL. | 881 // about:blank. |
| 882 // | 882 // See RenderProcessHostImpl::FilterURL to know which URLs are rewritten. |
| 883 // See https://crbug.com/657896 for details. | 883 // See https://crbug.com/657896 for details. |
| 884 bool is_about_blank = false; | 884 bool is_about_blank = false; |
| 885 ExplodedPageState exploded_page_state; | 885 ExplodedPageState exploded_page_state; |
| 886 if (DecodePageState(child->frame_entry->page_state().ToEncodedData(), | 886 if (DecodePageState(child->frame_entry->page_state().ToEncodedData(), |
| 887 &exploded_page_state)) { | 887 &exploded_page_state)) { |
| 888 ExplodedFrameState frame_state = exploded_page_state.top; | 888 ExplodedFrameState frame_state = exploded_page_state.top; |
| 889 if (UTF16ToUTF8(frame_state.url_string.string()) == url::kAboutBlankURL) | 889 if (UTF16ToUTF8(frame_state.url_string.string()) == url::kAboutBlankURL) |
| 890 is_about_blank = true; | 890 is_about_blank = true; |
| 891 } | 891 } |
| 892 | 892 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 return node; | 956 return node; |
| 957 | 957 |
| 958 // Enqueue any children and keep looking. | 958 // Enqueue any children and keep looking. |
| 959 for (auto* child : node->children) | 959 for (auto* child : node->children) |
| 960 work_queue.push(child); | 960 work_queue.push(child); |
| 961 } | 961 } |
| 962 return nullptr; | 962 return nullptr; |
| 963 } | 963 } |
| 964 | 964 |
| 965 } // namespace content | 965 } // namespace content |
| OLD | NEW |