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

Side by Side Diff: chrome/browser/password_manager/password_store_factory.cc

Issue 2714543006: Clean Obsolete HTTP Data from the Password Store (Closed)
Patch Set: Raw Cleaner Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/password_manager/password_store_factory.h" 5 #include "chrome/browser/password_manager/password_store_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/environment.h" 11 #include "base/environment.h"
12 #include "base/memory/ref_counted.h"
12 #include "base/metrics/histogram_macros.h" 13 #include "base/metrics/histogram_macros.h"
13 #include "base/rand_util.h" 14 #include "base/rand_util.h"
14 #include "base/threading/thread_task_runner_handle.h" 15 #include "base/threading/thread_task_runner_handle.h"
15 #include "build/build_config.h" 16 #include "build/build_config.h"
16 #include "chrome/browser/profiles/incognito_helpers.h" 17 #include "chrome/browser/profiles/incognito_helpers.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/sync/glue/sync_start_util.h" 19 #include "chrome/browser/sync/glue/sync_start_util.h"
19 #include "chrome/browser/sync/profile_sync_service_factory.h" 20 #include "chrome/browser/sync/profile_sync_service_factory.h"
20 #include "chrome/browser/web_data_service_factory.h" 21 #include "chrome/browser/web_data_service_factory.h"
21 #include "chrome/common/chrome_switches.h" 22 #include "chrome/common/chrome_switches.h"
22 #include "components/browser_sync/profile_sync_service.h" 23 #include "components/browser_sync/profile_sync_service.h"
23 #include "components/keyed_service/content/browser_context_dependency_manager.h" 24 #include "components/keyed_service/content/browser_context_dependency_manager.h"
24 #include "components/os_crypt/os_crypt_switches.h" 25 #include "components/os_crypt/os_crypt_switches.h"
26 #include "components/password_manager/core/browser/http_data_cleaner.h"
25 #include "components/password_manager/core/browser/login_database.h" 27 #include "components/password_manager/core/browser/login_database.h"
26 #include "components/password_manager/core/browser/password_store.h" 28 #include "components/password_manager/core/browser/password_store.h"
27 #include "components/password_manager/core/browser/password_store_default.h" 29 #include "components/password_manager/core/browser/password_store_default.h"
28 #include "components/password_manager/core/browser/password_store_factory_util.h " 30 #include "components/password_manager/core/browser/password_store_factory_util.h "
29 #include "components/password_manager/core/common/password_manager_pref_names.h" 31 #include "components/password_manager/core/common/password_manager_pref_names.h"
30 #include "components/pref_registry/pref_registry_syncable.h" 32 #include "components/pref_registry/pref_registry_syncable.h"
31 #include "components/prefs/pref_service.h" 33 #include "components/prefs/pref_service.h"
32 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
33 35
34 #if defined(OS_WIN) 36 #if defined(OS_WIN)
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 NOTIMPLEMENTED(); 262 NOTIMPLEMENTED();
261 #endif 263 #endif
262 DCHECK(ps); 264 DCHECK(ps);
263 if (!ps->Init( 265 if (!ps->Init(
264 sync_start_util::GetFlareForSyncableService(profile->GetPath()))) { 266 sync_start_util::GetFlareForSyncableService(profile->GetPath()))) {
265 // TODO(crbug.com/479725): Remove the LOG once this error is visible in the 267 // TODO(crbug.com/479725): Remove the LOG once this error is visible in the
266 // UI. 268 // UI.
267 LOG(WARNING) << "Could not initialize password store."; 269 LOG(WARNING) << "Could not initialize password store.";
268 return nullptr; 270 return nullptr;
269 } 271 }
272
273 password_manager::DelayCleanObsoleteHttpDataForPasswordStoreAndPrefs(
274 ps.get(), profile->GetPrefs(),
275 make_scoped_refptr(profile->GetRequestContext()));
276
270 return ps; 277 return ps;
271 } 278 }
272 279
273 void PasswordStoreFactory::RegisterProfilePrefs( 280 void PasswordStoreFactory::RegisterProfilePrefs(
274 user_prefs::PrefRegistrySyncable* registry) { 281 user_prefs::PrefRegistrySyncable* registry) {
275 #if !defined(OS_CHROMEOS) && defined(USE_X11) 282 #if !defined(OS_CHROMEOS) && defined(USE_X11)
276 // Notice that the preprocessor conditions above are exactly those that will 283 // Notice that the preprocessor conditions above are exactly those that will
277 // result in using PasswordStoreX in BuildServiceInstanceFor(). 284 // result in using PasswordStoreX in BuildServiceInstanceFor().
278 registry->RegisterIntegerPref(password_manager::prefs::kLocalProfileId, 285 registry->RegisterIntegerPref(password_manager::prefs::kLocalProfileId,
279 kInvalidLocalProfileId); 286 kInvalidLocalProfileId);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 break; 356 break;
350 case LIBSECRET: 357 case LIBSECRET:
351 usage = OTHER_LIBSECRET; 358 usage = OTHER_LIBSECRET;
352 break; 359 break;
353 } 360 }
354 } 361 }
355 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, 362 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage,
356 MAX_BACKEND_USAGE_VALUE); 363 MAX_BACKEND_USAGE_VALUE);
357 } 364 }
358 #endif 365 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698