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

Side by Side Diff: chrome/browser/chromeos/boot_times_recorder.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
« no previous file with comments | « chrome/browser/chromeos/base/locale_util.cc ('k') | chrome/browser/chromeos/camera_detector.cc » ('j') | 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/chromeos/boot_times_recorder.h" 5 #include "chrome/browser/chromeos/boot_times_recorder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 uptime.resize(space_at); 204 uptime.resize(space_at);
205 205
206 if (base::StringToDouble(uptime, result)) 206 if (base::StringToDouble(uptime, result))
207 return true; 207 return true;
208 208
209 return false; 209 return false;
210 } 210 }
211 211
212 void BootTimesRecorder::Stats::RecordStats(const std::string& name) const { 212 void BootTimesRecorder::Stats::RecordStats(const std::string& name) const {
213 base::PostTaskWithTraits( 213 base::PostTaskWithTraits(
214 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( 214 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
215 base::TaskPriority::BACKGROUND),
216 base::Bind(&BootTimesRecorder::Stats::RecordStatsAsync, 215 base::Bind(&BootTimesRecorder::Stats::RecordStatsAsync,
217 base::Owned(new Stats(*this)), name)); 216 base::Owned(new Stats(*this)), name));
218 } 217 }
219 218
220 void BootTimesRecorder::Stats::RecordStatsWithCallback( 219 void BootTimesRecorder::Stats::RecordStatsWithCallback(
221 const std::string& name, 220 const std::string& name,
222 const base::Closure& callback) const { 221 const base::Closure& callback) const {
223 base::PostTaskWithTraitsAndReply( 222 base::PostTaskWithTraitsAndReply(
224 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( 223 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
225 base::TaskPriority::BACKGROUND),
226 base::Bind(&BootTimesRecorder::Stats::RecordStatsAsync, 224 base::Bind(&BootTimesRecorder::Stats::RecordStatsAsync,
227 base::Owned(new Stats(*this)), name), 225 base::Owned(new Stats(*this)), name),
228 callback); 226 callback);
229 } 227 }
230 228
231 void BootTimesRecorder::Stats::RecordStatsAsync( 229 void BootTimesRecorder::Stats::RecordStatsAsync(
232 const base::FilePath::StringType& name) const { 230 const base::FilePath::StringType& name) const {
233 const base::FilePath log_path(kLogPath); 231 const base::FilePath log_path(kLogPath);
234 const base::FilePath uptime_output = 232 const base::FilePath uptime_output =
235 log_path.Append(base::FilePath(kUptimePrefix + name)); 233 log_path.Append(base::FilePath(kUptimePrefix + name));
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 GetRenderWidgetHost(&web_contents->GetController()); 521 GetRenderWidgetHost(&web_contents->GetController());
524 render_widget_hosts_loading_.erase(render_widget_host); 522 render_widget_hosts_loading_.erase(render_widget_host);
525 break; 523 break;
526 } 524 }
527 default: 525 default:
528 break; 526 break;
529 } 527 }
530 } 528 }
531 529
532 } // namespace chromeos 530 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/base/locale_util.cc ('k') | chrome/browser/chromeos/camera_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698