From 877830e4a1159f7bd31eb0c91b6859a3d7cb351f Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 29 Jul 2015 14:03:07 +0800 Subject: [PATCH] No need for default_download_path_ member. --- atom/browser/atom_browser_context.h | 2 +- atom/browser/atom_download_manager_delegate.cc | 8 ++++---- atom/browser/atom_download_manager_delegate.h | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/atom/browser/atom_browser_context.h b/atom/browser/atom_browser_context.h index 3455916fa5b3..c1ff613b8c07 100644 --- a/atom/browser/atom_browser_context.h +++ b/atom/browser/atom_browser_context.h @@ -32,7 +32,7 @@ class AtomBrowserContext : public brightray::BrowserContext { content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; content::BrowserPluginGuestManager* GetGuestManager() override; - // brightray::BrowserContext:: + // brightray::BrowserContext: void RegisterPrefs(PrefRegistrySimple* pref_registry) override; AtomURLRequestJobFactory* job_factory() const { return job_factory_; } diff --git a/atom/browser/atom_download_manager_delegate.cc b/atom/browser/atom_download_manager_delegate.cc index 7e393f7d2c21..b573a396332f 100644 --- a/atom/browser/atom_download_manager_delegate.cc +++ b/atom/browser/atom_download_manager_delegate.cc @@ -102,12 +102,12 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget( AtomBrowserContext* browser_context = static_cast( download_manager_->GetBrowserContext()); - default_download_path_ = browser_context->prefs()->GetFilePath( + base::FilePath default_download_path = browser_context->prefs()->GetFilePath( prefs::kDownloadDefaultDirectory); // If users didn't set download path, use 'Downloads' directory by default. - if (default_download_path_.empty()) { + if (default_download_path.empty()) { auto path = download_manager_->GetBrowserContext()->GetPath(); - default_download_path_ = path.Append(FILE_PATH_LITERAL("Downloads")); + default_download_path = path.Append(FILE_PATH_LITERAL("Downloads")); } if (!download->GetForcedFilePath().empty()) { @@ -131,7 +131,7 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget( download->GetContentDisposition(), download->GetSuggestedFilename(), download->GetMimeType(), - default_download_path_, + default_download_path, download_path_callback)); return true; } diff --git a/atom/browser/atom_download_manager_delegate.h b/atom/browser/atom_download_manager_delegate.h index e2d829243299..2df3a7d45a6b 100644 --- a/atom/browser/atom_download_manager_delegate.h +++ b/atom/browser/atom_download_manager_delegate.h @@ -47,7 +47,6 @@ class AtomDownloadManagerDelegate : public content::DownloadManagerDelegate { private: content::DownloadManager* download_manager_; - base::FilePath default_download_path_; base::WeakPtrFactory weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(AtomDownloadManagerDelegate);