summaryrefslogtreecommitdiffstats
path: root/chrome/utility
diff options
context:
space:
mode:
authorforshaw <forshaw@chromium.org>2015-12-03 11:30:41 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-03 19:31:44 +0000
commitd07bcf1b1fb4172a9a00fcc7bbddb685c0a33f8e (patch)
treef65c513ac0c9dcd163dceddc072f39ba8e09af5e /chrome/utility
parent7beecd2492a793f67270b3dda304b0dee17cf771 (diff)
downloadchromium_src-d07bcf1b1fb4172a9a00fcc7bbddb685c0a33f8e.zip
chromium_src-d07bcf1b1fb4172a9a00fcc7bbddb685c0a33f8e.tar.gz
chromium_src-d07bcf1b1fb4172a9a00fcc7bbddb685c0a33f8e.tar.bz2
Improved handling of importer profile creation.
This patch improves the handling of importer profile creation to remove reliance on bare pointers. It also wraps created importer objects in a scoped_refptr which is what the pointer is assigned to in the caller. BUG=539746 Review URL: https://codereview.chromium.org/1492663006 Cr-Commit-Position: refs/heads/master@{#363033}
Diffstat (limited to 'chrome/utility')
-rw-r--r--chrome/utility/importer/importer_creator.cc4
-rw-r--r--chrome/utility/importer/importer_creator.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/chrome/utility/importer/importer_creator.cc b/chrome/utility/importer/importer_creator.cc
index f260f8c..48c7c0c 100644
--- a/chrome/utility/importer/importer_creator.cc
+++ b/chrome/utility/importer/importer_creator.cc
@@ -23,7 +23,7 @@
namespace importer {
-Importer* CreateImporterByType(ImporterType type) {
+scoped_refptr<Importer> CreateImporterByType(ImporterType type) {
switch (type) {
#if defined(OS_WIN)
case TYPE_IE:
@@ -44,7 +44,7 @@ Importer* CreateImporterByType(ImporterType type) {
#endif
default:
NOTREACHED();
- return NULL;
+ return nullptr;
}
}
diff --git a/chrome/utility/importer/importer_creator.h b/chrome/utility/importer/importer_creator.h
index 40e0de5..dc61cd1 100644
--- a/chrome/utility/importer/importer_creator.h
+++ b/chrome/utility/importer/importer_creator.h
@@ -5,6 +5,7 @@
#ifndef CHROME_UTILITY_IMPORTER_IMPORTER_CREATOR_H_
#define CHROME_UTILITY_IMPORTER_IMPORTER_CREATOR_H_
+#include "base/memory/ref_counted.h"
#include "chrome/common/importer/importer_type.h"
class Importer;
@@ -12,7 +13,7 @@ class Importer;
namespace importer {
// Creates an Importer of the specified |type|.
-Importer* CreateImporterByType(ImporterType type);
+scoped_refptr<Importer> CreateImporterByType(ImporterType type);
} // namespace importer