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

Side by Side Diff: components/leveldb/env_mojo.cc

Issue 2855223002: Use constexpr TaskTraits constructor in components. (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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/leveldb/env_mojo.h" 5 #include "components/leveldb/env_mojo.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 uint64_t MojoEnv::NowMicros() { 406 uint64_t MojoEnv::NowMicros() {
407 return base::TimeTicks::Now().ToInternalValue(); 407 return base::TimeTicks::Now().ToInternalValue();
408 } 408 }
409 409
410 void MojoEnv::SleepForMicroseconds(int micros) { 410 void MojoEnv::SleepForMicroseconds(int micros) {
411 // Round up to the next millisecond. 411 // Round up to the next millisecond.
412 base::PlatformThread::Sleep(base::TimeDelta::FromMicroseconds(micros)); 412 base::PlatformThread::Sleep(base::TimeDelta::FromMicroseconds(micros));
413 } 413 }
414 414
415 void MojoEnv::Schedule(void (*function)(void* arg), void* arg) { 415 void MojoEnv::Schedule(void (*function)(void* arg), void* arg) {
416 base::PostTaskWithTraits( 416 base::PostTaskWithTraits(FROM_HERE,
417 FROM_HERE, 417 {base::MayBlock(), base::WithBaseSyncPrimitives(),
418 base::TaskTraits() 418 base::TaskShutdownBehavior::BLOCK_SHUTDOWN},
419 .MayBlock() 419 base::Bind(function, arg));
420 .WithBaseSyncPrimitives()
421 .WithShutdownBehavior(base::TaskShutdownBehavior::BLOCK_SHUTDOWN),
422 base::Bind(function, arg));
423 } 420 }
424 421
425 void MojoEnv::StartThread(void (*function)(void* arg), void* arg) { 422 void MojoEnv::StartThread(void (*function)(void* arg), void* arg) {
426 new Thread(function, arg); // Will self-delete. 423 new Thread(function, arg); // Will self-delete.
427 } 424 }
428 425
429 } // namespace leveldb 426 } // namespace leveldb
OLDNEW
« no previous file with comments | « components/history/core/browser/history_service.cc ('k') | components/nacl/browser/nacl_browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698