Chromium Code Reviews| 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> |
| 11 | 11 |
| 12 #include "base/debug/dump_without_crashing.h" | |
| 13 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 14 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 15 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 16 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 18 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 19 #include "components/url_formatter/url_formatter.h" | 18 #include "components/url_formatter/url_formatter.h" |
| 20 #include "content/common/content_constants_internal.h" | 19 #include "content/common/content_constants_internal.h" |
| 21 #include "content/common/navigation_params.h" | 20 #include "content/common/navigation_params.h" |
| 22 #include "content/common/page_state_serialization.h" | 21 #include "content/common/page_state_serialization.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 // frame's PageState. (We don't pass the list to subframes below.) | 58 // frame's PageState. (We don't pass the list to subframes below.) |
| 60 // TODO(creis): Grant access to this list for each process that renders | 59 // TODO(creis): Grant access to this list for each process that renders |
| 61 // this page, even for OOPIFs. Eventually keep track of a verified list of | 60 // this page, even for OOPIFs. Eventually keep track of a verified list of |
| 62 // files per frame, so that we only grant access to processes that need it. | 61 // files per frame, so that we only grant access to processes that need it. |
| 63 if (referenced_files.size() > 0) | 62 if (referenced_files.size() > 0) |
| 64 page_state.referenced_files = referenced_files; | 63 page_state.referenced_files = referenced_files; |
| 65 | 64 |
| 66 page_state.top = state; | 65 page_state.top = state; |
| 67 std::string data; | 66 std::string data; |
| 68 EncodePageState(page_state, &data); | 67 EncodePageState(page_state, &data); |
| 69 if (data.empty()) { | |
| 70 // Temporarily generate a minidump to diagnose https://crbug.com/568703. | |
| 71 base::debug::DumpWithoutCrashing(); | |
| 72 NOTREACHED() << "Shouldn't generate an empty PageState."; | |
|
alexmos
2017/02/23 18:05:12
Just to make sure -- do we want to remove everythi
Charlie Reis
2017/02/28 05:30:57
Sure, a DCHECK makes sense here.
| |
| 73 } | |
| 74 node->frame_entry->SetPageState(PageState::CreateFromEncodedData(data)); | 68 node->frame_entry->SetPageState(PageState::CreateFromEncodedData(data)); |
| 75 | 69 |
| 76 // Don't pass the file list to subframes, since that would result in multiple | 70 // Don't pass the file list to subframes, since that would result in multiple |
| 77 // copies of it ending up in the combined list in GetPageState (via | 71 // copies of it ending up in the combined list in GetPageState (via |
| 78 // RecursivelyGenerateFrameState). | 72 // RecursivelyGenerateFrameState). |
| 79 std::vector<base::NullableString16> empty_file_list; | 73 std::vector<base::NullableString16> empty_file_list; |
| 80 | 74 |
| 81 for (const ExplodedFrameState& child_state : state.children) { | 75 for (const ExplodedFrameState& child_state : state.children) { |
| 82 NavigationEntryImpl::TreeNode* child_node = | 76 NavigationEntryImpl::TreeNode* child_node = |
| 83 new NavigationEntryImpl::TreeNode(node, nullptr); | 77 new NavigationEntryImpl::TreeNode(node, nullptr); |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 952 return node; | 946 return node; |
| 953 | 947 |
| 954 // Enqueue any children and keep looking. | 948 // Enqueue any children and keep looking. |
| 955 for (auto* child : node->children) | 949 for (auto* child : node->children) |
| 956 work_queue.push(child); | 950 work_queue.push(child); |
| 957 } | 951 } |
| 958 return nullptr; | 952 return nullptr; |
| 959 } | 953 } |
| 960 | 954 |
| 961 } // namespace content | 955 } // namespace content |
| OLD | NEW |