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

Side by Side Diff: third_party/leveldatabase/env_chromium.cc

Issue 9303006: Convert use of int ms to TimeDelta in scattered chromium files. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 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 | « ppapi/proxy/ppb_message_loop_proxy.cc ('k') | 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) 2011 The LevelDB Authors. All rights reserved. 1 // Copyright (c) 2011 The LevelDB 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. See the AUTHORS file for names of contributors. 3 // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 4
5 #include <deque> 5 #include <deque>
6 #include <errno.h> 6 #include <errno.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 *result = new ChromiumLogger(fname); 441 *result = new ChromiumLogger(fname);
442 return Status::OK(); 442 return Status::OK();
443 } 443 }
444 444
445 virtual uint64_t NowMicros() { 445 virtual uint64_t NowMicros() {
446 return ::base::TimeTicks::Now().ToInternalValue(); 446 return ::base::TimeTicks::Now().ToInternalValue();
447 } 447 }
448 448
449 virtual void SleepForMicroseconds(int micros) { 449 virtual void SleepForMicroseconds(int micros) {
450 // Round up to the next millisecond. 450 // Round up to the next millisecond.
451 ::base::PlatformThread::Sleep((micros + 999) / 1000); 451 ::base::PlatformThread::Sleep(::base::TimeDelta::FromMicroseconds(micros));
452 } 452 }
453 453
454 private: 454 private:
455 // BGThread() is the body of the background thread 455 // BGThread() is the body of the background thread
456 void BGThread(); 456 void BGThread();
457 static void BGThreadWrapper(void* arg) { 457 static void BGThreadWrapper(void* arg) {
458 reinterpret_cast<ChromiumEnv*>(arg)->BGThread(); 458 reinterpret_cast<ChromiumEnv*>(arg)->BGThread();
459 } 459 }
460 460
461 FilePath test_directory_; 461 FilePath test_directory_;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 ::base::LazyInstance<ChromiumEnv>::Leaky 547 ::base::LazyInstance<ChromiumEnv>::Leaky
548 default_env = LAZY_INSTANCE_INITIALIZER; 548 default_env = LAZY_INSTANCE_INITIALIZER;
549 549
550 } 550 }
551 551
552 Env* Env::Default() { 552 Env* Env::Default() {
553 return default_env.Pointer(); 553 return default_env.Pointer();
554 } 554 }
555 555
556 } 556 }
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_message_loop_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698