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

Side by Side Diff: chrome/browser/component_updater/sw_reporter_installer_win.cc

Issue 2596853002: Update TaskTraits in sw_reporter_installer_win.cc. (Closed)
Patch Set: Created 3 years, 12 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 | « 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 (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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/component_updater/sw_reporter_installer_win.h" 5 #include "chrome/browser/component_updater/sw_reporter_installer_win.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // the current browser startup is complete. (This is the default 129 // the current browser startup is complete. (This is the default
130 // |reporter_runner| function passed to the |SwReporterInstallerTraits| 130 // |reporter_runner| function passed to the |SwReporterInstallerTraits|
131 // constructor in |RegisterSwReporterComponent| below.) 131 // constructor in |RegisterSwReporterComponent| below.)
132 void RunSwReportersAfterStartup( 132 void RunSwReportersAfterStartup(
133 const safe_browsing::SwReporterQueue& invocations, 133 const safe_browsing::SwReporterQueue& invocations,
134 const base::Version& version) { 134 const base::Version& version) {
135 content::BrowserThread::PostAfterStartupTask( 135 content::BrowserThread::PostAfterStartupTask(
136 FROM_HERE, base::ThreadTaskRunnerHandle::Get(), 136 FROM_HERE, base::ThreadTaskRunnerHandle::Get(),
137 base::Bind(&safe_browsing::RunSwReporters, invocations, version, 137 base::Bind(&safe_browsing::RunSwReporters, invocations, version,
138 base::ThreadTaskRunnerHandle::Get(), 138 base::ThreadTaskRunnerHandle::Get(),
139 // Runs LaunchAndWaitForExit() (srt_fetcher_win.cc). 139 // Runs LaunchAndWaitForExit() which creates and joins a
140 // process, hence MayBlock() and WithSyncPrimitives().
gab 2016/12/21 16:11:01 // Runs LaunchAndWaitForExit() which creates (MayB
joenotcharles 2016/12/21 16:20:36 Yes, please clarify this.
fdoray 2016/12/21 16:28:42 Done.
140 base::CreateTaskRunnerWithTraits( 141 base::CreateTaskRunnerWithTraits(
141 base::TaskTraits() 142 base::TaskTraits()
142 .WithShutdownBehavior( 143 .WithShutdownBehavior(
143 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) 144 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
144 .WithPriority(base::TaskPriority::BACKGROUND) 145 .WithPriority(base::TaskPriority::BACKGROUND)
145 .WithWait()))); 146 .MayBlock()
147 .WithSyncPrimitives())));
146 } 148 }
147 149
148 // Ensures |str| contains only alphanumeric characters and characters from 150 // Ensures |str| contains only alphanumeric characters and characters from
149 // |extras|, and is not longer than |max_length|. 151 // |extras|, and is not longer than |max_length|.
150 bool ValidateString(const std::string& str, 152 bool ValidateString(const std::string& str,
151 const std::string& extras, 153 const std::string& extras,
152 size_t max_length) { 154 size_t max_length) {
153 return str.size() <= max_length && 155 return str.size() <= max_length &&
154 std::all_of(str.cbegin(), str.cend(), [&extras](char c) { 156 std::all_of(str.cbegin(), str.cend(), [&extras](char c) {
155 return base::IsAsciiAlpha(c) || base::IsAsciiDigit(c) || 157 return base::IsAsciiAlpha(c) || base::IsAsciiDigit(c) ||
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 499 }
498 500
499 void RegisterProfilePrefsForSwReporter( 501 void RegisterProfilePrefsForSwReporter(
500 user_prefs::PrefRegistrySyncable* registry) { 502 user_prefs::PrefRegistrySyncable* registry) {
501 registry->RegisterStringPref(prefs::kSwReporterPromptVersion, ""); 503 registry->RegisterStringPref(prefs::kSwReporterPromptVersion, "");
502 504
503 registry->RegisterStringPref(prefs::kSwReporterPromptSeed, ""); 505 registry->RegisterStringPref(prefs::kSwReporterPromptSeed, "");
504 } 506 }
505 507
506 } // namespace component_updater 508 } // namespace component_updater
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