| 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 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/debug/dump_without_crashing.h" | |
| 14 #include "base/feature_list.h" | 13 #include "base/feature_list.h" |
| 15 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
| 16 #include "base/location.h" | 15 #include "base/location.h" |
| 17 #include "base/logging.h" | 16 #include "base/logging.h" |
| 18 #include "base/macros.h" | 17 #include "base/macros.h" |
| 19 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 20 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
| 21 #include "base/process/process.h" | 20 #include "base/process/process.h" |
| 22 #include "base/profiler/scoped_tracker.h" | 21 #include "base/profiler/scoped_tracker.h" |
| 23 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 #include "content/browser/web_contents/web_contents_view_guest.h" | 74 #include "content/browser/web_contents/web_contents_view_guest.h" |
| 76 #include "content/browser/webui/generic_handler.h" | 75 #include "content/browser/webui/generic_handler.h" |
| 77 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 76 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
| 78 #include "content/browser/webui/web_ui_impl.h" | 77 #include "content/browser/webui/web_ui_impl.h" |
| 79 #include "content/common/browser_plugin/browser_plugin_constants.h" | 78 #include "content/common/browser_plugin/browser_plugin_constants.h" |
| 80 #include "content/common/browser_plugin/browser_plugin_messages.h" | 79 #include "content/common/browser_plugin/browser_plugin_messages.h" |
| 81 #include "content/common/frame_messages.h" | 80 #include "content/common/frame_messages.h" |
| 82 #include "content/common/input/web_input_event_traits.h" | 81 #include "content/common/input/web_input_event_traits.h" |
| 83 #include "content/common/input_messages.h" | 82 #include "content/common/input_messages.h" |
| 84 #include "content/common/page_messages.h" | 83 #include "content/common/page_messages.h" |
| 85 #include "content/common/page_state_serialization.h" | |
| 86 #include "content/common/site_isolation_policy.h" | 84 #include "content/common/site_isolation_policy.h" |
| 87 #include "content/common/ssl_status_serialization.h" | 85 #include "content/common/ssl_status_serialization.h" |
| 88 #include "content/common/view_messages.h" | 86 #include "content/common/view_messages.h" |
| 89 #include "content/public/browser/ax_event_notification_details.h" | 87 #include "content/public/browser/ax_event_notification_details.h" |
| 90 #include "content/public/browser/browser_context.h" | 88 #include "content/public/browser/browser_context.h" |
| 91 #include "content/public/browser/browser_plugin_guest_manager.h" | 89 #include "content/public/browser/browser_plugin_guest_manager.h" |
| 92 #include "content/public/browser/content_browser_client.h" | 90 #include "content/public/browser/content_browser_client.h" |
| 93 #include "content/public/browser/devtools_agent_host.h" | 91 #include "content/public/browser/devtools_agent_host.h" |
| 94 #include "content/public/browser/download_manager.h" | 92 #include "content/public/browser/download_manager.h" |
| 95 #include "content/public/browser/download_url_parameters.h" | 93 #include "content/public/browser/download_url_parameters.h" |
| (...skipping 4374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4470 // The SiteInstance might not match if we do a cross-process navigation with | 4468 // The SiteInstance might not match if we do a cross-process navigation with |
| 4471 // replacement (e.g., auto-subframe), in which case the swap out of the old | 4469 // replacement (e.g., auto-subframe), in which case the swap out of the old |
| 4472 // RenderFrameHost runs in the background after the old FrameNavigationEntry | 4470 // RenderFrameHost runs in the background after the old FrameNavigationEntry |
| 4473 // has already been replaced and destroyed. | 4471 // has already been replaced and destroyed. |
| 4474 if (frame_entry->site_instance() != rfhi->GetSiteInstance()) | 4472 if (frame_entry->site_instance() != rfhi->GetSiteInstance()) |
| 4475 return; | 4473 return; |
| 4476 | 4474 |
| 4477 if (page_state == frame_entry->page_state()) | 4475 if (page_state == frame_entry->page_state()) |
| 4478 return; // Nothing to update. | 4476 return; // Nothing to update. |
| 4479 | 4477 |
| 4480 // The document_sequence_number and item_sequence_number recorded in the | |
| 4481 // FrameNavigationEntry should not differ from the one coming with the update, | |
| 4482 // since it must come from the same document. | |
| 4483 ExplodedPageState exploded_state; | |
| 4484 if (!DecodePageState(page_state.ToEncodedData(), &exploded_state)) | |
| 4485 return; | |
| 4486 | |
| 4487 if (exploded_state.top.document_sequence_number != | |
| 4488 frame_entry->document_sequence_number() || | |
| 4489 exploded_state.top.item_sequence_number != | |
| 4490 frame_entry->item_sequence_number()) { | |
| 4491 // Generate a minidump, which can be debugged to understand the root cause | |
| 4492 // this unexpected update. | |
| 4493 // TODO(nasko): Remove once https://crbug.com/628677 is understood. | |
| 4494 base::debug::Alias(&page_state); | |
| 4495 base::debug::DumpWithoutCrashing(); | |
| 4496 return; | |
| 4497 } | |
| 4498 | |
| 4499 frame_entry->set_page_state(page_state); | 4478 frame_entry->set_page_state(page_state); |
| 4500 controller_.NotifyEntryChanged(entry); | 4479 controller_.NotifyEntryChanged(entry); |
| 4501 } | 4480 } |
| 4502 | 4481 |
| 4503 void WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host, | 4482 void WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host, |
| 4504 int32_t page_id, | 4483 int32_t page_id, |
| 4505 const base::string16& title, | 4484 const base::string16& title, |
| 4506 base::i18n::TextDirection title_direction) { | 4485 base::i18n::TextDirection title_direction) { |
| 4507 // If we have a title, that's a pretty good indication that we've started | 4486 // If we have a title, that's a pretty good indication that we've started |
| 4508 // getting useful data. | 4487 // getting useful data. |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5174 for (RenderViewHost* render_view_host : render_view_host_set) | 5153 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5175 render_view_host->OnWebkitPreferencesChanged(); | 5154 render_view_host->OnWebkitPreferencesChanged(); |
| 5176 } | 5155 } |
| 5177 | 5156 |
| 5178 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5157 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 5179 JavaScriptDialogManager* dialog_manager) { | 5158 JavaScriptDialogManager* dialog_manager) { |
| 5180 dialog_manager_ = dialog_manager; | 5159 dialog_manager_ = dialog_manager; |
| 5181 } | 5160 } |
| 5182 | 5161 |
| 5183 } // namespace content | 5162 } // namespace content |
| OLD | NEW |