| 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" |
| 13 #include "base/feature_list.h" | 14 #include "base/feature_list.h" |
| 14 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
| 15 #include "base/location.h" | 16 #include "base/location.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "base/macros.h" | 18 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 19 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
| 20 #include "base/process/process.h" | 21 #include "base/process/process.h" |
| 21 #include "base/profiler/scoped_tracker.h" | 22 #include "base/profiler/scoped_tracker.h" |
| 22 #include "base/single_thread_task_runner.h" | 23 #include "base/single_thread_task_runner.h" |
| (...skipping 4497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4520 // The SiteInstance might not match if we do a cross-process navigation with | 4521 // The SiteInstance might not match if we do a cross-process navigation with |
| 4521 // replacement (e.g., auto-subframe), in which case the swap out of the old | 4522 // replacement (e.g., auto-subframe), in which case the swap out of the old |
| 4522 // RenderFrameHost runs in the background after the old FrameNavigationEntry | 4523 // RenderFrameHost runs in the background after the old FrameNavigationEntry |
| 4523 // has already been replaced and destroyed. | 4524 // has already been replaced and destroyed. |
| 4524 if (frame_entry->site_instance() != rfhi->GetSiteInstance()) | 4525 if (frame_entry->site_instance() != rfhi->GetSiteInstance()) |
| 4525 return; | 4526 return; |
| 4526 | 4527 |
| 4527 if (page_state == frame_entry->page_state()) | 4528 if (page_state == frame_entry->page_state()) |
| 4528 return; // Nothing to update. | 4529 return; // Nothing to update. |
| 4529 | 4530 |
| 4531 if (!page_state.IsValid()) { |
| 4532 // Temporarily generate a minidump to diagnose https://crbug.com/568703. |
| 4533 base::debug::DumpWithoutCrashing(); |
| 4534 NOTREACHED() << "Shouldn't set an empty PageState."; |
| 4535 } |
| 4530 frame_entry->set_page_state(page_state); | 4536 frame_entry->set_page_state(page_state); |
| 4531 controller_.NotifyEntryChanged(entry); | 4537 controller_.NotifyEntryChanged(entry); |
| 4532 } | 4538 } |
| 4533 | 4539 |
| 4534 void WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host, | 4540 void WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host, |
| 4535 int32_t page_id, | 4541 int32_t page_id, |
| 4536 const base::string16& title, | 4542 const base::string16& title, |
| 4537 base::i18n::TextDirection title_direction) { | 4543 base::i18n::TextDirection title_direction) { |
| 4538 // If we have a title, that's a pretty good indication that we've started | 4544 // If we have a title, that's a pretty good indication that we've started |
| 4539 // getting useful data. | 4545 // getting useful data. |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5207 for (RenderViewHost* render_view_host : render_view_host_set) | 5213 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5208 render_view_host->OnWebkitPreferencesChanged(); | 5214 render_view_host->OnWebkitPreferencesChanged(); |
| 5209 } | 5215 } |
| 5210 | 5216 |
| 5211 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5217 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 5212 JavaScriptDialogManager* dialog_manager) { | 5218 JavaScriptDialogManager* dialog_manager) { |
| 5213 dialog_manager_ = dialog_manager; | 5219 dialog_manager_ = dialog_manager; |
| 5214 } | 5220 } |
| 5215 | 5221 |
| 5216 } // namespace content | 5222 } // namespace content |
| OLD | NEW |