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 3577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3598 FOR_EACH_OBSERVER(WebContentsObserver, | 3597 FOR_EACH_OBSERVER(WebContentsObserver, |
3599 observers_, | 3598 observers_, |
3600 RenderProcessGone(GetCrashedStatus())); | 3599 RenderProcessGone(GetCrashedStatus())); |
3601 } | 3600 } |
3602 | 3601 |
3603 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { | 3602 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { |
3604 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); | 3603 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); |
3605 } | 3604 } |
3606 | 3605 |
3607 void WebContentsImpl::UpdateState(RenderViewHost* rvh, | 3606 void WebContentsImpl::UpdateState(RenderViewHost* rvh, |
3608 int32 rvh_page_id, | |
3609 int32 page_id, | 3607 int32 page_id, |
3610 const PageState& page_state) { | 3608 const PageState& page_state) { |
3611 if (rvh_page_id != page_id) { | |
3612 base::debug::SetCrashKeyValue("renderer_page_id", | |
3613 base::IntToString(page_id)); | |
3614 base::debug::SetCrashKeyValue("browser_page_id", | |
3615 base::IntToString(rvh_page_id)); | |
3616 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( | |
3617 controller_.GetLastCommittedEntry()); | |
3618 // The question being answered here is: when there is a page id mismatch | |
3619 // between the renderer and the browser, which value (if either) matches | |
3620 // that of the last committed entry? | |
3621 if (entry) { | |
3622 if (entry->site_instance() == rvh->GetSiteInstance()) { | |
3623 base::debug::SetCrashKeyValue("last_committed_page_id", | |
3624 base::IntToString(entry->GetPageID())); | |
3625 } else { | |
3626 base::debug::SetCrashKeyValue("last_committed_page_id", | |
3627 "site instance mismatch"); | |
3628 } | |
3629 } else { | |
3630 base::debug::SetCrashKeyValue("last_committed_page_id", "no entry"); | |
3631 } | |
3632 CHECK(false); | |
3633 } | |
3634 | |
3635 // Ensure that this state update comes from a RenderViewHost that belongs to | 3609 // Ensure that this state update comes from a RenderViewHost that belongs to |
3636 // this WebContents. | 3610 // this WebContents. |
3637 // TODO(nasko): This should go through RenderFrameHost. | 3611 // TODO(nasko): This should go through RenderFrameHost. |
3638 // TODO(creis): We can't update state for cross-process subframes until we | 3612 // TODO(creis): We can't update state for cross-process subframes until we |
3639 // have FrameNavigationEntries. Once we do, this should be a DCHECK. | 3613 // have FrameNavigationEntries. Once we do, this should be a DCHECK. |
3640 if (rvh->GetDelegate()->GetAsWebContents() != this) | 3614 if (rvh->GetDelegate()->GetAsWebContents() != this) |
3641 return; | 3615 return; |
3642 | 3616 |
3643 // We must be prepared to handle state updates for any page, these occur | 3617 // We must be prepared to handle state updates for any page, these occur |
3644 // when the user is scrolling and entering form data, as well as when we're | 3618 // when the user is scrolling and entering form data, as well as when we're |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4381 node->render_manager()->ResumeResponseDeferredAtStart(); | 4355 node->render_manager()->ResumeResponseDeferredAtStart(); |
4382 } | 4356 } |
4383 | 4357 |
4384 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4358 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4385 force_disable_overscroll_content_ = force_disable; | 4359 force_disable_overscroll_content_ = force_disable; |
4386 if (view_) | 4360 if (view_) |
4387 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4361 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4388 } | 4362 } |
4389 | 4363 |
4390 } // namespace content | 4364 } // namespace content |
OLD | NEW |