Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[DevTools] Address crash by checking if Tab loaded successfully
Browse files Browse the repository at this point in the history
* Changes Tab::LoadIfNeeded()/Tab.loadIfNeeded() to return true
  if the call was "handled" and false if it failed.

* DevTools checks if LoadIfNeeded() fails, and bails out if it
  does.

BUG=403592

Committed: https://crrev.com/b90614c44a566be2ed618df1e036cd441538c6ef
Cr-Commit-Position: refs/heads/master@{#297482}

[email protected]

Review URL: https://codereview.chromium.org/618513002

Cr-Commit-Position: refs/branch-heads/2171@{#42}
Cr-Branched-From: 267aeeb-refs/heads/master@{#297060}
  • Loading branch information
[email protected] committed Oct 3, 2014
1 parent 43ca431 commit 251bb22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ public Bitmap getFavicon() {

/**
* Loads the tab if it's not loaded (e.g. because it was killed in background).
* @return true iff tab load was triggered
* @return true iff the Tab handled the request.
*/
@CalledByNative
public boolean loadIfNeeded() {
Expand Down
4 changes: 3 additions & 1 deletion chrome/browser/android/dev_tools_manager_delegate_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ class TabTarget : public TargetBase {
if (!tab)
return NULL;

tab->LoadIfNeeded();
if (!tab->LoadIfNeeded())
return NULL;

web_contents = model->GetWebContentsAt(index);
if (!web_contents)
return NULL;
Expand Down

0 comments on commit 251bb22

Please sign in to comment.