Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/debug/dump_without_crashing.h" | |
| 15 #include "base/feature_list.h" | 14 #include "base/feature_list.h" |
| 16 #include "base/i18n/character_encoding.h" | 15 #include "base/i18n/character_encoding.h" |
| 17 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
| 18 #include "base/location.h" | 17 #include "base/location.h" |
| 19 #include "base/logging.h" | 18 #include "base/logging.h" |
| 20 #include "base/macros.h" | 19 #include "base/macros.h" |
| 21 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
| 22 #include "base/memory/ref_counted.h" | 21 #include "base/memory/ref_counted.h" |
| 23 #include "base/metrics/histogram_macros.h" | 22 #include "base/metrics/histogram_macros.h" |
| 24 #include "base/process/process.h" | 23 #include "base/process/process.h" |
| (...skipping 4577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4602 // The SiteInstance might not match if we do a cross-process navigation with | 4601 // The SiteInstance might not match if we do a cross-process navigation with |
| 4603 // replacement (e.g., auto-subframe), in which case the swap out of the old | 4602 // replacement (e.g., auto-subframe), in which case the swap out of the old |
| 4604 // RenderFrameHost runs in the background after the old FrameNavigationEntry | 4603 // RenderFrameHost runs in the background after the old FrameNavigationEntry |
| 4605 // has already been replaced and destroyed. | 4604 // has already been replaced and destroyed. |
| 4606 if (frame_entry->site_instance() != rfhi->GetSiteInstance()) | 4605 if (frame_entry->site_instance() != rfhi->GetSiteInstance()) |
| 4607 return; | 4606 return; |
| 4608 | 4607 |
| 4609 if (page_state == frame_entry->page_state()) | 4608 if (page_state == frame_entry->page_state()) |
| 4610 return; // Nothing to update. | 4609 return; // Nothing to update. |
| 4611 | 4610 |
| 4612 if (!page_state.IsValid()) { | |
| 4613 // Temporarily generate a minidump to diagnose https://crbug.com/568703. | |
| 4614 base::debug::DumpWithoutCrashing(); | |
|
alexmos
2017/02/23 18:05:12
Ha, I actually found one of these! See b310b2c700
Charlie Reis
2017/02/28 05:30:57
Wow, interesting. And another one just came in: 0
| |
| 4615 NOTREACHED() << "Shouldn't set an empty PageState."; | |
| 4616 } | |
| 4617 | |
| 4618 // The document_sequence_number and item_sequence_number recorded in the | 4611 // The document_sequence_number and item_sequence_number recorded in the |
| 4619 // FrameNavigationEntry should not differ from the one coming with the update, | 4612 // FrameNavigationEntry should not differ from the one coming with the update, |
| 4620 // since it must come from the same document. Do not update it if a difference | 4613 // since it must come from the same document. Do not update it if a difference |
| 4621 // is detected, as this indicates that |frame_entry| is not the correct one. | 4614 // is detected, as this indicates that |frame_entry| is not the correct one. |
| 4622 ExplodedPageState exploded_state; | 4615 ExplodedPageState exploded_state; |
| 4623 if (!DecodePageState(page_state.ToEncodedData(), &exploded_state)) | 4616 if (!DecodePageState(page_state.ToEncodedData(), &exploded_state)) |
| 4624 return; | 4617 return; |
| 4625 | 4618 |
| 4626 if (exploded_state.top.document_sequence_number != | 4619 if (exploded_state.top.document_sequence_number != |
| 4627 frame_entry->document_sequence_number() || | 4620 frame_entry->document_sequence_number() || |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5428 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5421 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
| 5429 if (!render_view_host) | 5422 if (!render_view_host) |
| 5430 continue; | 5423 continue; |
| 5431 render_view_host_set.insert(render_view_host); | 5424 render_view_host_set.insert(render_view_host); |
| 5432 } | 5425 } |
| 5433 for (RenderViewHost* render_view_host : render_view_host_set) | 5426 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5434 render_view_host->OnWebkitPreferencesChanged(); | 5427 render_view_host->OnWebkitPreferencesChanged(); |
| 5435 } | 5428 } |
| 5436 | 5429 |
| 5437 } // namespace content | 5430 } // namespace content |
| OLD | NEW |