Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3580)

Unified Diff: chrome/browser/ui/webui/net_export_ui.cc

Issue 2863283002: Fix a crash on Chrome OS when selecting a file in chrome://net-export/ (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/net_export_ui.cc
diff --git a/chrome/browser/ui/webui/net_export_ui.cc b/chrome/browser/ui/webui/net_export_ui.cc
index abc8b81a58464600c3ef950f34f9a5bc97f82e51..c886b6d825e2fd0ad888a33d19db790d7fb987a8 100644
--- a/chrome/browser/ui/webui/net_export_ui.cc
+++ b/chrome/browser/ui/webui/net_export_ui.cc
@@ -300,10 +300,13 @@ void NetExportMessageHandler::FileSelected(const base::FilePath& path,
void* params) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(select_file_dialog_);
- select_file_dialog_ = nullptr;
*last_save_dir.Pointer() = path.DirName();
file_writer_->StartNetLog(path, capture_mode_, GetURLRequestContexts());
+
+ // IMPORTANT: resetting the dialog may lead to the deletion of |path|, so keep
+ // this line last.
+ select_file_dialog_ = nullptr;
}
void NetExportMessageHandler::FileSelectionCanceled(void* params) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698