Title: [229289] trunk/Source/WTF
Revision
229289
Author
[email protected]
Date
2018-03-05 11:03:59 -0800 (Mon, 05 Mar 2018)

Log Message

Unreviewed, follow-up after r229209
https://bugs.webkit.org/show_bug.cgi?id=183312

Add RELEASE_ASSERT to ensure success.

* wtf/cocoa/CPUTimeCocoa.mm:
(WTF::CPUTime::forCurrentThread):
* wtf/unix/CPUTimeUnix.cpp:
(WTF::CPUTime::forCurrentThread):
* wtf/win/CPUTimeWin.cpp:
(WTF::CPUTime::forCurrentThread):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (229288 => 229289)


--- trunk/Source/WTF/ChangeLog	2018-03-05 18:43:53 UTC (rev 229288)
+++ trunk/Source/WTF/ChangeLog	2018-03-05 19:03:59 UTC (rev 229289)
@@ -1,5 +1,19 @@
 2018-03-05  Yusuke Suzuki  <[email protected]>
 
+        Unreviewed, follow-up after r229209
+        https://bugs.webkit.org/show_bug.cgi?id=183312
+
+        Add RELEASE_ASSERT to ensure success.
+
+        * wtf/cocoa/CPUTimeCocoa.mm:
+        (WTF::CPUTime::forCurrentThread):
+        * wtf/unix/CPUTimeUnix.cpp:
+        (WTF::CPUTime::forCurrentThread):
+        * wtf/win/CPUTimeWin.cpp:
+        (WTF::CPUTime::forCurrentThread):
+
+2018-03-05  Yusuke Suzuki  <[email protected]>
+
         Unreviewed, fix MediaTime test
         https://bugs.webkit.org/show_bug.cgi?id=183319
 

Modified: trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.mm (229288 => 229289)


--- trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.mm	2018-03-05 18:43:53 UTC (rev 229288)
+++ trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.mm	2018-03-05 19:03:59 UTC (rev 229289)
@@ -76,7 +76,8 @@
     thread_basic_info_data_t info;
 
     mach_port_t threadPort = mach_thread_self();
-    thread_info(threadPort, THREAD_BASIC_INFO, reinterpret_cast<thread_info_t>(&info), &infoCount);
+    auto ret = thread_info(threadPort, THREAD_BASIC_INFO, reinterpret_cast<thread_info_t>(&info), &infoCount);
+    RELEASE_ASSERT(ret == KERN_SUCCESS);
     mach_port_deallocate(mach_task_self(), threadPort);
 
     return Seconds(info.user_time.seconds + info.system_time.seconds) + Seconds::fromMicroseconds(info.user_time.microseconds + info.system_time.microseconds);

Modified: trunk/Source/WTF/wtf/unix/CPUTimeUnix.cpp (229288 => 229289)


--- trunk/Source/WTF/wtf/unix/CPUTimeUnix.cpp	2018-03-05 18:43:53 UTC (rev 229288)
+++ trunk/Source/WTF/wtf/unix/CPUTimeUnix.cpp	2018-03-05 19:03:59 UTC (rev 229289)
@@ -47,7 +47,8 @@
 Seconds CPUTime::forCurrentThread()
 {
     struct timespec ts { };
-    clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
+    int ret = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
+    RELEASE_ASSERT(!ret);
     return Seconds(ts.tv_sec) + Seconds::fromNanoseconds(ts.tv_nsec);
 }
 

Modified: trunk/Source/WTF/wtf/win/CPUTimeWin.cpp (229288 => 229289)


--- trunk/Source/WTF/wtf/win/CPUTimeWin.cpp	2018-03-05 18:43:53 UTC (rev 229288)
+++ trunk/Source/WTF/wtf/win/CPUTimeWin.cpp	2018-03-05 19:03:59 UTC (rev 229289)
@@ -65,7 +65,7 @@
     FILETIME userTime, kernelTime, creationTime, exitTime;
 
     BOOL ret = GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime);
-    ASSERT_UNUSED(ret, ret);
+    RELEASE_ASSERT(ret);
 
     return fileTimeToSeconds(userTime) + fileTimeToSeconds(kernelTime);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to