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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/crash_logging.h" | |
11 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
12 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
13 #include "base/logging.h" | 12 #include "base/logging.h" |
14 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
15 #include "base/metrics/stats_counters.h" | 14 #include "base/metrics/stats_counters.h" |
16 #include "base/process/process.h" | 15 #include "base/process/process.h" |
17 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
18 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
20 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
(...skipping 3561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3582 FOR_EACH_OBSERVER(WebContentsObserver, | 3581 FOR_EACH_OBSERVER(WebContentsObserver, |
3583 observers_, | 3582 observers_, |
3584 RenderProcessGone(GetCrashedStatus())); | 3583 RenderProcessGone(GetCrashedStatus())); |
3585 } | 3584 } |
3586 | 3585 |
3587 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { | 3586 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { |
3588 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); | 3587 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); |
3589 } | 3588 } |
3590 | 3589 |
3591 void WebContentsImpl::UpdateState(RenderViewHost* rvh, | 3590 void WebContentsImpl::UpdateState(RenderViewHost* rvh, |
3592 int32 rvh_page_id, | |
3593 int32 page_id, | 3591 int32 page_id, |
3594 const PageState& page_state) { | 3592 const PageState& page_state) { |
3595 if (rvh_page_id != page_id) { | |
3596 base::debug::SetCrashKeyValue("renderer_page_id", | |
3597 base::IntToString(page_id)); | |
3598 base::debug::SetCrashKeyValue("browser_page_id", | |
3599 base::IntToString(rvh_page_id)); | |
3600 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( | |
3601 controller_.GetLastCommittedEntry()); | |
3602 // The question being answered here is: when there is a page id mismatch | |
3603 // between the renderer and the browser, which value (if either) matches | |
3604 // that of the last committed entry? | |
3605 if (entry) { | |
3606 if (entry->site_instance() == rvh->GetSiteInstance()) { | |
3607 base::debug::SetCrashKeyValue("last_committed_page_id", | |
3608 base::IntToString(entry->GetPageID())); | |
3609 } else { | |
3610 base::debug::SetCrashKeyValue("last_committed_page_id", | |
3611 "site instance mismatch"); | |
3612 } | |
3613 } else { | |
3614 base::debug::SetCrashKeyValue("last_committed_page_id", "no entry"); | |
3615 } | |
3616 CHECK(false); | |
3617 } | |
3618 // Ensure that this state update comes from either the active RVH or one of | 3593 // Ensure that this state update comes from either the active RVH or one of |
3619 // the swapped out RVHs. We don't expect to hear from any other RVHs. | 3594 // the swapped out RVHs. We don't expect to hear from any other RVHs. |
3620 // TODO(nasko): This should go through RenderFrameHost. | 3595 // TODO(nasko): This should go through RenderFrameHost. |
3621 // TODO(creis): We can't update state for cross-process subframes until we | 3596 // TODO(creis): We can't update state for cross-process subframes until we |
3622 // have FrameNavigationEntries. Once we do, this should be a DCHECK. | 3597 // have FrameNavigationEntries. Once we do, this should be a DCHECK. |
3623 if (rvh != GetRenderViewHost() && | 3598 if (rvh != GetRenderViewHost() && |
3624 !GetRenderManager()->IsRVHOnSwappedOutList( | 3599 !GetRenderManager()->IsRVHOnSwappedOutList( |
3625 static_cast<RenderViewHostImpl*>(rvh))) | 3600 static_cast<RenderViewHostImpl*>(rvh))) |
3626 return; | 3601 return; |
3627 | 3602 |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4350 node->render_manager()->ResumeResponseDeferredAtStart(); | 4325 node->render_manager()->ResumeResponseDeferredAtStart(); |
4351 } | 4326 } |
4352 | 4327 |
4353 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4328 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4354 force_disable_overscroll_content_ = force_disable; | 4329 force_disable_overscroll_content_ = force_disable; |
4355 if (view_) | 4330 if (view_) |
4356 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4331 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4357 } | 4332 } |
4358 | 4333 |
4359 } // namespace content | 4334 } // namespace content |
OLD | NEW |