From 5e677cb4fe1cc138c65e5463d074929e6d9ef8f4 Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Mon, 26 Feb 2018 22:20:21 +0000 Subject: [PATCH] Merge pull request #511 from brave/browser-laptop-issue-13254 Fix empty devtool profile --- atom/browser/common_web_contents_delegate.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index bd2f6340a..60871814f 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -490,8 +490,12 @@ void CommonWebContentsDelegate::OnSaveFileSelected( const std::string& content, const std::vector& paths) { DCHECK(!paths.empty()); - WriteToFile(paths[0], content); - OnDevToolsSaveToFile(url); + saved_files_[url] = paths[0]; + BrowserThread::PostTaskAndReply( + BrowserThread::FILE, FROM_HERE, + base::Bind(&WriteToFile, paths[0], content), + base::Bind(&CommonWebContentsDelegate::OnDevToolsSaveToFile, + base::Unretained(this), url)); } void CommonWebContentsDelegate::OnSaveFileSelectionCancelled( const std::string url) {