Skip to content

Commit

Permalink
recent: Fix crash in OnGetRecentFiles()
Browse files Browse the repository at this point in the history
render_frame_host() can be null after finishing async operations.
Remove DCHECK to stop accessing it.

BUG=762797
TEST=build
[email protected]

(cherry picked from commit 9ccbde3)

Change-Id: I2e05eca525bea28fb1ac3d75f3dbc500c7bd50c7
Reviewed-on: https://chromium-review.googlesource.com/654279
Reviewed-by: Tomasz Mikolajewski <[email protected]>
Reviewed-by: Shuhei Takahashi <[email protected]>
Commit-Queue: Ryo Hashimoto <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#500229}
Reviewed-on: https://chromium-review.googlesource.com/656745
Reviewed-by: Ryo Hashimoto <[email protected]>
Cr-Commit-Position: refs/branch-heads/3202@{#84}
Cr-Branched-From: fa6a5d8-refs/heads/master@{#499098}
  • Loading branch information
Ryo Hashimoto committed Sep 8, 2017
1 parent 10d0030 commit 6d09a73
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -750,19 +750,8 @@ FileManagerPrivateInternalGetRecentFilesFunction::Run() {
void FileManagerPrivateInternalGetRecentFilesFunction::OnGetRecentFiles(
api::file_manager_private::SourceRestriction restriction,
const std::vector<chromeos::RecentFile>& files) {
scoped_refptr<storage::FileSystemContext> file_system_context =
file_manager::util::GetFileSystemContextForRenderFrameHost(
chrome_details_.GetProfile(), render_frame_host());
DCHECK(file_system_context.get());

const storage::ExternalFileSystemBackend* external_backend =
file_system_context->external_backend();
DCHECK(external_backend);

file_manager::util::FileDefinitionList file_definition_list;
for (const auto& file : files) {
DCHECK(external_backend->CanHandleType(file.url().type()));

// Filter out files from non-allowed sources.
// We do this filtering here rather than in RecentModel so that the set of
// files returned with some restriction is a subset of what would be
Expand Down

0 comments on commit 6d09a73

Please sign in to comment.