diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/object_watcher_unittest.cc | 4 | ||||
-rw-r--r-- | base/observer_list_threadsafe.h | 2 | ||||
-rw-r--r-- | base/process_util_mac.mm | 12 | ||||
-rw-r--r-- | base/time_posix.cc | 42 | ||||
-rw-r--r-- | base/time_win_unittest.cc | 2 | ||||
-rw-r--r-- | base/trace_event.cc | 2 |
6 files changed, 32 insertions, 32 deletions
diff --git a/base/object_watcher_unittest.cc b/base/object_watcher_unittest.cc index f6b265e..7b3a3a6 100644 --- a/base/object_watcher_unittest.cc +++ b/base/object_watcher_unittest.cc @@ -90,12 +90,12 @@ void RunTest_CancelAfterSet(MessageLoop::Type message_loop_type) { Sleep(30); watcher.StopWatching(); - + MessageLoop::current()->RunAllPending(); // Our delegate should not have fired. EXPECT_EQ(1, counter); - + CloseHandle(event); } diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h index dfff061..ce30ce0 100644 --- a/base/observer_list_threadsafe.h +++ b/base/observer_list_threadsafe.h @@ -148,7 +148,7 @@ class ObserverListThreadSafe // ObserverList. This function MUST be called on the thread which owns // the unsafe ObserverList. template <class Method, class Params> - void NotifyWrapper(ObserverList<ObserverType>* list, + void NotifyWrapper(ObserverList<ObserverType>* list, const UnboundMethod<ObserverType, Method, Params>& method) { // Check that this list still needs notifications. diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm index f90070b..ff78c07 100644 --- a/base/process_util_mac.mm +++ b/base/process_util_mac.mm @@ -158,7 +158,7 @@ const ProcessEntry* NamedProcessIterator::NextProcessEntry() { if (result) { return &entry_; } - + return NULL; } @@ -167,14 +167,14 @@ bool NamedProcessIterator::CheckForNextProcess() { std::string data; std::string exec_name; - + for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++index_of_kinfo_proc_) { kinfo_proc* kinfo = &kinfo_procs_[index_of_kinfo_proc_]; // Skip processes just awaiting collection if ((kinfo->kp_proc.p_pid > 0) && (kinfo->kp_proc.p_stat == SZOMB)) continue; - + int mib[] = { CTL_KERN, KERN_PROCARGS, kinfo->kp_proc.p_pid }; // Found out what size buffer we need @@ -183,13 +183,13 @@ bool NamedProcessIterator::CheckForNextProcess() { LOG(ERROR) << "failed to figure out the buffer size for a commandline"; continue; } - + data.resize(data_len); if (sysctl(mib, arraysize(mib), &data[0], &data_len, NULL, 0) < 0) { LOG(ERROR) << "failed to fetch a commandline"; continue; } - + // Data starts w/ the full path null termed, so we have to extract just the // executable name from the path. @@ -203,7 +203,7 @@ bool NamedProcessIterator::CheckForNextProcess() { exec_name = data.substr(0, exec_name_end); else exec_name = data.substr(last_slash + 1, exec_name_end - last_slash - 1); - + // Check the name if (executable_name_utf8 == exec_name) { entry_.pid = kinfo->kp_proc.p_pid; diff --git a/base/time_posix.cc b/base/time_posix.cc index 894d1af..6885cad 100644 --- a/base/time_posix.cc +++ b/base/time_posix.cc @@ -129,27 +129,27 @@ TimeTicks TimeTicks::Now() { static mach_timebase_info_data_t timebase_info; if (timebase_info.denom == 0) { // Zero-initialization of statics guarantees that denom will be 0 before - // calling mach_timebase_info. mach_timebase_info will never set denom to - // 0 as that would be invalid, so the zero-check can be used to determine - // whether mach_timebase_info has already been called. This is - // recommended by Apple's QA1398. - kern_return_t kr = mach_timebase_info(&timebase_info); - DCHECK(kr == KERN_SUCCESS); - } - - // mach_absolute_time is it when it comes to ticks on the Mac. Other calls - // with less precision (such as TickCount) just call through to - // mach_absolute_time. - - // timebase_info converts absolute time tick units into nanoseconds. Convert - // to microseconds up front to stave off overflows. - absolute_micro = mach_absolute_time() / Time::kNanosecondsPerMicrosecond * - timebase_info.numer / timebase_info.denom; - - // Don't bother with the rollover handling that the Windows version does. - // With numer and denom = 1 (the expected case), the 64-bit absolute time - // reported in nanoseconds is enough to last nearly 585 years. - + // calling mach_timebase_info. mach_timebase_info will never set denom to + // 0 as that would be invalid, so the zero-check can be used to determine + // whether mach_timebase_info has already been called. This is + // recommended by Apple's QA1398. + kern_return_t kr = mach_timebase_info(&timebase_info); + DCHECK(kr == KERN_SUCCESS); + } + + // mach_absolute_time is it when it comes to ticks on the Mac. Other calls + // with less precision (such as TickCount) just call through to + // mach_absolute_time. + + // timebase_info converts absolute time tick units into nanoseconds. Convert + // to microseconds up front to stave off overflows. + absolute_micro = mach_absolute_time() / Time::kNanosecondsPerMicrosecond * + timebase_info.numer / timebase_info.denom; + + // Don't bother with the rollover handling that the Windows version does. + // With numer and denom = 1 (the expected case), the 64-bit absolute time + // reported in nanoseconds is enough to last nearly 585 years. + #elif defined(OS_POSIX) && \ defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 diff --git a/base/time_win_unittest.cc b/base/time_win_unittest.cc index 9244f7a5..1e76a39 100644 --- a/base/time_win_unittest.cc +++ b/base/time_win_unittest.cc @@ -109,7 +109,7 @@ TEST(TimeTicks, WinRollover) { TEST(TimeTicks, SubMillisecondTimers) { // Loop for a bit getting timers quickly. We want to - // see at least one case where we get a new sample in + // see at least one case where we get a new sample in // less than one millisecond. bool saw_submillisecond_timer = false; int64 min_timer = 1000; diff --git a/base/trace_event.cc b/base/trace_event.cc index 400e878..ccac825b 100644 --- a/base/trace_event.cc +++ b/base/trace_event.cc @@ -139,7 +139,7 @@ void TraceLog::Trace(const std::string& name, name.c_str(), id, extra.c_str(), - file, + file, line, usec); |