| Index: chrome/browser/profiles/profile_keyed_base_factory.cc
|
| diff --git a/chrome/browser/profiles/profile_keyed_base_factory.cc b/chrome/browser/profiles/profile_keyed_base_factory.cc
|
| index 8277f87372db1f76c06c7662041a777658c8b8fb..a9ea56036f50f12c10cde34a67a62ff9eac7bd96 100644
|
| --- a/chrome/browser/profiles/profile_keyed_base_factory.cc
|
| +++ b/chrome/browser/profiles/profile_keyed_base_factory.cc
|
| @@ -4,10 +4,12 @@
|
|
|
| #include "chrome/browser/profiles/profile_keyed_base_factory.h"
|
|
|
| +#include "base/command_line.h"
|
| #include "base/prefs/pref_service.h"
|
| #include "chrome/browser/prefs/pref_registry_syncable.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/profiles/profile_dependency_manager.h"
|
| +#include "chrome/browser/profiles/profile_manager.h"
|
|
|
| ProfileKeyedBaseFactory::ProfileKeyedBaseFactory(
|
| const char* name, ProfileDependencyManager* manager)
|
| @@ -49,6 +51,14 @@ Profile* ProfileKeyedBaseFactory::GetProfileToUse(Profile* profile) {
|
| }
|
| }
|
|
|
| + // If this is the import process, most services are not created to avoid
|
| + // conflicts with non-shareable resources used by the same service running in
|
| + // the browser process.
|
| + if (ProfileManager::IsImportProcess(*CommandLine::ForCurrentProcess()) &&
|
| + ServiceIsNULLOnImportProcess()) {
|
| + return NULL;
|
| + }
|
| +
|
| return profile;
|
| }
|
|
|
| @@ -102,6 +112,10 @@ bool ProfileKeyedBaseFactory::ServiceIsNULLWhileTesting() const {
|
| return false;
|
| }
|
|
|
| +bool ProfileKeyedBaseFactory::ServiceIsNULLOnImportProcess() const {
|
| + return true;
|
| +}
|
| +
|
| void ProfileKeyedBaseFactory::ProfileDestroyed(Profile* profile) {
|
| // While object destruction can be customized in ways where the object is
|
| // only dereferenced, this still must run on the UI thread.
|
|
|