Skip to content

Commit

Permalink
Add DumpWithoutCrashing to CaptivePortalTabHelper
Browse files Browse the repository at this point in the history
Add several calls to DumpWithoutCrashing to CaptivePortalTabHelper to
try to understand what is causing crbug.com/704892.

BUG=704892

Review-Url: https://codereview.chromium.org/2796573005
Cr-Commit-Position: refs/heads/master@{#462443}
  • Loading branch information
clamy authored and Commit bot committed Apr 6, 2017
1 parent 2dc6e6c commit 0ffe901
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion chrome/browser/captive_portal/captive_portal_tab_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "chrome/browser/captive_portal/captive_portal_tab_helper.h"

#include "base/bind.h"
#include "base/debug/dump_without_crashing.h"
#include "chrome/browser/captive_portal/captive_portal_login_detector.h"
#include "chrome/browser/captive_portal/captive_portal_service_factory.h"
#include "chrome/browser/captive_portal/captive_portal_tab_reloader.h"
Expand Down Expand Up @@ -60,6 +61,11 @@ void CaptivePortalTabHelper::DidStartNavigation(
if (!navigation_handle->IsInMainFrame())
return;

// TODO(clamy): Remove this when we understand the root cause behind
// crbug.com/704892.
if (navigation_handle == navigation_handle_)
base::debug::DumpWithoutCrashing();

// Always track the latest navigation. If a navigation was already tracked,
// and it committed (either the navigation proper or an error page), it is
// safe to start tracking the new navigation. Otherwise simulate an abort
Expand All @@ -86,8 +92,13 @@ void CaptivePortalTabHelper::DidRedirectNavigation(
void CaptivePortalTabHelper::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!navigation_handle->IsInMainFrame())
if (!navigation_handle->IsInMainFrame()) {
if (navigation_handle == navigation_handle_)
// TODO(clamy): Remove this when we understand the root cause behind
// crbug.com/704892.
base::debug::DumpWithoutCrashing();
return;
}

if (navigation_handle_ != navigation_handle) {
// Another navigation is being tracked, so there is no need to update the
Expand All @@ -99,6 +110,11 @@ void CaptivePortalTabHelper::DidFinishNavigation(
DidStartNavigation(navigation_handle);
}

// TODO(clamy): Remove this when we understand the root cause behind
// crbug.com/704892.
if (navigation_handle != navigation_handle_)
base::debug::DumpWithoutCrashing();

if (navigation_handle->HasCommitted()) {
tab_reloader_->OnLoadCommitted(navigation_handle->GetNetErrorCode());
} else {
Expand Down

0 comments on commit 0ffe901

Please sign in to comment.