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

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

Issue 2858073002: Use constexpr TaskTraits constructor in chrome. (Closed)
Patch Set: Created 3 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
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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // This task calls ::LogonUser(), hence MayBlock().
211 base::PostTaskWithTraitsAndReply( 211 base::PostTaskWithTraitsAndReply(
212 FROM_HERE, base::TaskTraits() 212 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
213 .WithPriority(base::TaskPriority::BACKGROUND)
214 .MayBlock(),
215 base::Bind(&GetOsPasswordStatusInternal, prefs_weak, status_weak), 213 base::Bind(&GetOsPasswordStatusInternal, prefs_weak, status_weak),
216 base::Bind(&ReplyOsPasswordStatus, base::Passed(&prefs), 214 base::Bind(&ReplyOsPasswordStatus, base::Passed(&prefs),
217 base::Passed(&status))); 215 base::Passed(&status)));
218 } 216 }
219 217
220 } // namespace 218 } // namespace
221 219
222 void DelayReportOsPassword() { 220 void DelayReportOsPassword() {
223 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, FROM_HERE, 221 content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, FROM_HERE,
224 base::Bind(&GetOsPasswordStatus), 222 base::Bind(&GetOsPasswordStatus),
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 310 }
313 } 311 }
314 SecureZeroMemory(password, sizeof(password)); 312 SecureZeroMemory(password, sizeof(password));
315 } 313 }
316 } while (credErr == NO_ERROR && 314 } while (credErr == NO_ERROR &&
317 (retval == false && tries < kMaxPasswordRetries)); 315 (retval == false && tries < kMaxPasswordRetries));
318 return retval; 316 return retval;
319 } 317 }
320 318
321 } // namespace password_manager_util_win 319 } // namespace password_manager_util_win
OLDNEW
« no previous file with comments | « chrome/browser/ntp_snippets/content_suggestions_service_factory.cc ('k') | chrome/browser/pepper_flash_settings_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698