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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2032283002: Remove refcounting from SavePackage. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index bfdda50f69c982a5208572a106e7b34157cfed2d..2eb1af27f255f93378d6b16cd270a83f02824c2e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -14,6 +14,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram.h"
#include "base/process/process.h"
@@ -2754,7 +2755,7 @@ void WebContentsImpl::OnSavePage() {
// Create the save package and possibly prompt the user for the name to save
// the page as. The user prompt is an asynchronous operation that runs on
// another thread.
- save_package_ = new SavePackage(this);
+ save_package_ = base::WrapUnique(new SavePackage(this));
asanka 2016/06/06 18:55:09 Here and elsewhere: Assigning a unique_ptr and re
save_package_->GetSaveInfo();
}
@@ -2767,7 +2768,8 @@ bool WebContentsImpl::SavePage(const base::FilePath& main_file,
// Stop the page from navigating.
Stop();
- save_package_ = new SavePackage(this, save_type, main_file, dir_path);
+ save_package_ =
+ base::WrapUnique(new SavePackage(this, save_type, main_file, dir_path));
return save_package_->Init(SavePackageDownloadCreatedCallback());
}
« content/browser/download/save_package.h ('K') | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698