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

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

Issue 1115583002: [chrome/browser/password_manager] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/password_manager/password_store_win_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_x.h" 5 #include "chrome/browser/password_manager/password_store_x.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (!forms->empty()) 179 if (!forms->empty())
180 allow_fallback_ = false; 180 allow_fallback_ = false;
181 return true; 181 return true;
182 } 182 }
183 if (allow_default_store()) 183 if (allow_default_store())
184 return PasswordStoreDefault::FillBlacklistLogins(forms); 184 return PasswordStoreDefault::FillBlacklistLogins(forms);
185 return false; 185 return false;
186 } 186 }
187 187
188 void PasswordStoreX::CheckMigration() { 188 void PasswordStoreX::CheckMigration() {
189 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 189 DCHECK_CURRENTLY_ON(BrowserThread::DB);
190 if (migration_checked_ || !backend_.get()) 190 if (migration_checked_ || !backend_.get())
191 return; 191 return;
192 migration_checked_ = true; 192 migration_checked_ = true;
193 ssize_t migrated = MigrateLogins(); 193 ssize_t migrated = MigrateLogins();
194 if (migrated > 0) { 194 if (migrated > 0) {
195 VLOG(1) << "Migrated " << migrated << " passwords to native store."; 195 VLOG(1) << "Migrated " << migrated << " passwords to native store.";
196 } else if (migrated == 0) { 196 } else if (migrated == 0) {
197 // As long as we are able to migrate some passwords, we know the native 197 // As long as we are able to migrate some passwords, we know the native
198 // store is working. But if there is nothing to migrate, the "migration" 198 // store is working. But if there is nothing to migrate, the "migration"
199 // can succeed even when the native store would fail. In this case we 199 // can succeed even when the native store would fail. In this case we
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 // Finally, delete the database file itself. We remove the passwords from 252 // Finally, delete the database file itself. We remove the passwords from
253 // it before deleting the file just in case there is some problem deleting 253 // it before deleting the file just in case there is some problem deleting
254 // the file (e.g. directory is not writable, but file is), which would 254 // the file (e.g. directory is not writable, but file is), which would
255 // otherwise cause passwords to re-migrate next (or maybe every) time. 255 // otherwise cause passwords to re-migrate next (or maybe every) time.
256 DeleteAndRecreateDatabaseFile(); 256 DeleteAndRecreateDatabaseFile();
257 } 257 }
258 } 258 }
259 ssize_t result = ok ? forms.size() : -1; 259 ssize_t result = ok ? forms.size() : -1;
260 return result; 260 return result;
261 } 261 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_store_win_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698