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

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

Issue 2592123003: Update TaskTraits in password_manager_util_win.cc. (Closed)
Patch Set: Created 4 years 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 | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // windows.h must be first otherwise Win8 SDK breaks. 5 // windows.h must be first otherwise Win8 SDK breaks.
6 #include <windows.h> 6 #include <windows.h>
7 #include <LM.h> 7 #include <LM.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <wincred.h> 10 #include <wincred.h>
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 void GetOsPasswordStatus() { 200 void GetOsPasswordStatus() {
201 // Preferences can be accessed on the UI thread only. 201 // Preferences can be accessed on the UI thread only.
202 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 202 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
203 PrefService* local_state = g_browser_process->local_state(); 203 PrefService* local_state = g_browser_process->local_state();
204 std::unique_ptr<PasswordCheckPrefs> prefs(new PasswordCheckPrefs); 204 std::unique_ptr<PasswordCheckPrefs> prefs(new PasswordCheckPrefs);
205 prefs->Read(local_state); 205 prefs->Read(local_state);
206 std::unique_ptr<OsPasswordStatus> status( 206 std::unique_ptr<OsPasswordStatus> status(
207 new OsPasswordStatus(PASSWORD_STATUS_UNKNOWN)); 207 new OsPasswordStatus(PASSWORD_STATUS_UNKNOWN));
208 PasswordCheckPrefs* prefs_weak = prefs.get(); 208 PasswordCheckPrefs* prefs_weak = prefs.get();
209 OsPasswordStatus* status_weak = status.get(); 209 OsPasswordStatus* status_weak = status.get();
210 // This task calls ::LogonUser(), hence MayBlock().
210 base::PostTaskWithTraitsAndReply( 211 base::PostTaskWithTraitsAndReply(
211 FROM_HERE, base::TaskTraits() 212 FROM_HERE, base::TaskTraits()
212 .WithPriority(base::TaskPriority::BACKGROUND) 213 .WithPriority(base::TaskPriority::BACKGROUND)
213 .WithWait(), 214 .MayBlock(),
214 base::Bind(&GetOsPasswordStatusInternal, prefs_weak, status_weak), 215 base::Bind(&GetOsPasswordStatusInternal, prefs_weak, status_weak),
215 base::Bind(&ReplyOsPasswordStatus, base::Passed(&prefs), 216 base::Bind(&ReplyOsPasswordStatus, base::Passed(&prefs),
216 base::Passed(&status))); 217 base::Passed(&status)));
217 } 218 }
218 219
219 } // namespace 220 } // namespace
220 221
221 void DelayReportOsPassword() { 222 void DelayReportOsPassword() {
222 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, FROM_HERE, 223 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, FROM_HERE,
223 base::Bind(&GetOsPasswordStatus), 224 base::Bind(&GetOsPasswordStatus),
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 318 }
318 } 319 }
319 SecureZeroMemory(password, sizeof(password)); 320 SecureZeroMemory(password, sizeof(password));
320 } 321 }
321 } while (credErr == NO_ERROR && 322 } while (credErr == NO_ERROR &&
322 (retval == false && tries < kMaxPasswordRetries)); 323 (retval == false && tries < kMaxPasswordRetries));
323 return retval; 324 return retval;
324 } 325 }
325 326
326 } // namespace password_manager_util_win 327 } // namespace password_manager_util_win
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698