Title: [125802] trunk/Source
Revision
125802
Author
[email protected]
Date
2012-08-16 12:54:00 -0700 (Thu, 16 Aug 2012)

Log Message

[Chromium] Avoid aliasing global symbol monotonicallyIncreasingTime().
https://bugs.webkit.org/show_bug.cgi?id=94233

Patch by David Reveman <[email protected]> on 2012-08-16
Reviewed by James Robinson.

Source/WebCore:

Rename virtual function CCDelayBasedTimeSource::monotonicallyIncreasingTime()
that exist for testing purposes to CCDelayBasedTimeSource::monotonicTimeNow().

No new tests.

* platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp:
(WebCore::CCDelayBasedTimeSource::setActive):
(WebCore::CCDelayBasedTimeSource::onTimerFired):
(WebCore::CCDelayBasedTimeSource::monotonicTimeNow):
* platform/graphics/chromium/cc/CCDelayBasedTimeSource.h:

Source/WebKit/chromium:

* tests/CCDelayBasedTimeSourceTest.cpp:
(WebKitTests::TEST):
* tests/CCFrameRateControllerTest.cpp:
(WebKitTests::TEST):
* tests/CCSchedulerTestCommon.h:
(WebKitTests::FakeCCDelayBasedTimeSource::setMonotonicTimeNow):
(WebKitTests::FakeCCDelayBasedTimeSource::FakeCCDelayBasedTimeSource):
(FakeCCDelayBasedTimeSource):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125801 => 125802)


--- trunk/Source/WebCore/ChangeLog	2012-08-16 19:50:22 UTC (rev 125801)
+++ trunk/Source/WebCore/ChangeLog	2012-08-16 19:54:00 UTC (rev 125802)
@@ -1,5 +1,23 @@
 2012-08-16  David Reveman  <[email protected]>
 
+        [Chromium] Avoid aliasing global symbol monotonicallyIncreasingTime().
+        https://bugs.webkit.org/show_bug.cgi?id=94233
+
+        Reviewed by James Robinson.
+
+        Rename virtual function CCDelayBasedTimeSource::monotonicallyIncreasingTime()
+        that exist for testing purposes to CCDelayBasedTimeSource::monotonicTimeNow().
+
+        No new tests.
+
+        * platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp:
+        (WebCore::CCDelayBasedTimeSource::setActive):
+        (WebCore::CCDelayBasedTimeSource::onTimerFired):
+        (WebCore::CCDelayBasedTimeSource::monotonicTimeNow):
+        * platform/graphics/chromium/cc/CCDelayBasedTimeSource.h:
+
+2012-08-16  David Reveman  <[email protected]>
+
         [Chromium] Schedule texture uploads based on hard-coded timer and vsync.
         https://bugs.webkit.org/show_bug.cgi?id=84281
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp (125801 => 125802)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp	2012-08-16 19:50:22 UTC (rev 125801)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp	2012-08-16 19:54:00 UTC (rev 125802)
@@ -88,7 +88,7 @@
 
     m_state = STATE_ACTIVE;
 
-    double now = monotonicallyIncreasingTime();
+    double now = monotonicTimeNow();
     postNextTickTask(now);
 }
 
@@ -106,7 +106,7 @@
 {
     ASSERT(m_state != STATE_INACTIVE);
 
-    double now = monotonicallyIncreasingTime();
+    double now = monotonicTimeNow();
     m_lastTickTime = now;
 
     if (m_state == STATE_STARTING) {
@@ -157,9 +157,9 @@
     }
 }
 
-double CCDelayBasedTimeSource::monotonicallyIncreasingTime() const
+double CCDelayBasedTimeSource::monotonicTimeNow() const
 {
-    return WTF::monotonicallyIncreasingTime();
+    return monotonicallyIncreasingTime();
 }
 
 // This code tries to achieve an average tick rate as close to m_intervalMs as possible.

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h (125801 => 125802)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h	2012-08-16 19:50:22 UTC (rev 125801)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h	2012-08-16 19:54:00 UTC (rev 125802)
@@ -59,7 +59,7 @@
     virtual void onTimerFired() OVERRIDE;
 
     // Virtual for testing.
-    virtual double monotonicallyIncreasingTime() const;
+    virtual double monotonicTimeNow() const;
 
 protected:
     CCDelayBasedTimeSource(double interval, CCThread*);

Modified: trunk/Source/WebKit/chromium/ChangeLog (125801 => 125802)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-16 19:50:22 UTC (rev 125801)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-16 19:54:00 UTC (rev 125802)
@@ -1,5 +1,21 @@
 2012-08-16  David Reveman  <[email protected]>
 
+        [Chromium] Avoid aliasing global symbol monotonicallyIncreasingTime().
+        https://bugs.webkit.org/show_bug.cgi?id=94233
+
+        Reviewed by James Robinson.
+
+        * tests/CCDelayBasedTimeSourceTest.cpp:
+        (WebKitTests::TEST):
+        * tests/CCFrameRateControllerTest.cpp:
+        (WebKitTests::TEST):
+        * tests/CCSchedulerTestCommon.h:
+        (WebKitTests::FakeCCDelayBasedTimeSource::setMonotonicTimeNow):
+        (WebKitTests::FakeCCDelayBasedTimeSource::FakeCCDelayBasedTimeSource):
+        (FakeCCDelayBasedTimeSource):
+
+2012-08-16  David Reveman  <[email protected]>
+
         [Chromium] Schedule texture uploads based on hard-coded timer and vsync.
         https://bugs.webkit.org/show_bug.cgi?id=84281
 

Modified: trunk/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp (125801 => 125802)


--- trunk/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp	2012-08-16 19:50:22 UTC (rev 125801)
+++ trunk/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp	2012-08-16 19:54:00 UTC (rev 125802)
@@ -44,12 +44,12 @@
     RefPtr<FakeCCDelayBasedTimeSource> timer = FakeCCDelayBasedTimeSource::create(1.0 / 60.0, &thread);
     timer->setClient(&client);
 
-    timer->setMonotonicallyIncreasingTime(0);
+    timer->setMonotonicTimeNow(0);
     timer->setActive(true);
     EXPECT_TRUE(timer->active());
     EXPECT_TRUE(thread.hasPendingTask());
 
-    timer->setMonotonicallyIncreasingTime(0.016);
+    timer->setMonotonicTimeNow(0.016);
     thread.runPendingTask();
     EXPECT_TRUE(timer->active());
     EXPECT_TRUE(client.tickCalled());
@@ -109,7 +109,7 @@
 
     EXPECT_EQ(16, thread.pendingDelayMs());
 
-    timer->setMonotonicallyIncreasingTime(interval);
+    timer->setMonotonicTimeNow(interval);
     thread.runPendingTask();
 
     EXPECT_EQ(16, thread.pendingDelayMs());
@@ -130,7 +130,7 @@
 
     EXPECT_EQ(16, thread.pendingDelayMs());
 
-    timer->setMonotonicallyIncreasingTime(interval + 0.0000001);
+    timer->setMonotonicTimeNow(interval + 0.0000001);
     thread.runPendingTask();
 
     EXPECT_EQ(16, thread.pendingDelayMs());
@@ -151,7 +151,7 @@
 
     EXPECT_EQ(16, thread.pendingDelayMs());
 
-    timer->setMonotonicallyIncreasingTime(2*interval);
+    timer->setMonotonicTimeNow(2*interval);
     thread.runPendingTask();
 
     EXPECT_EQ(16, thread.pendingDelayMs());
@@ -172,7 +172,7 @@
 
     EXPECT_EQ(16, thread.pendingDelayMs());
 
-    timer->setMonotonicallyIncreasingTime(2*interval + 0.0000001);
+    timer->setMonotonicTimeNow(2*interval + 0.0000001);
     thread.runPendingTask();
 
     EXPECT_EQ(16, thread.pendingDelayMs());
@@ -193,7 +193,7 @@
 
     EXPECT_EQ(16, thread.pendingDelayMs());
 
-    timer->setMonotonicallyIncreasingTime(interval + interval * 0.5);
+    timer->setMonotonicTimeNow(interval + interval * 0.5);
     thread.runPendingTask();
 
     EXPECT_EQ(8, thread.pendingDelayMs());
@@ -216,7 +216,7 @@
 
     // Jitter timebase ~1ms late
     timer->setTimebaseAndInterval(interval + 0.001, interval);
-    timer->setMonotonicallyIncreasingTime(interval);
+    timer->setMonotonicTimeNow(interval);
     thread.runPendingTask();
 
     // Without double tick prevention, pendingDelayMs would be 1.
@@ -224,7 +224,7 @@
 
     // Jitter timebase ~1ms early
     timer->setTimebaseAndInterval(interval * 2 - 0.001, interval);
-    timer->setMonotonicallyIncreasingTime(interval * 2);
+    timer->setMonotonicTimeNow(interval * 2);
     thread.runPendingTask();
 
     EXPECT_EQ(15, thread.pendingDelayMs());
@@ -244,7 +244,7 @@
     EXPECT_EQ(16, thread.pendingDelayMs());
 
     // Tick, then shift timebase by +7ms.
-    timer->setMonotonicallyIncreasingTime(interval);
+    timer->setMonotonicTimeNow(interval);
     thread.runPendingTask();
 
     EXPECT_EQ(16, thread.pendingDelayMs());
@@ -258,7 +258,7 @@
     EXPECT_EQ(7, thread.pendingDelayMs());
 
     // Tick, then shift timebase by -7ms.
-    timer->setMonotonicallyIncreasingTime(interval + 0.0070001);
+    timer->setMonotonicTimeNow(interval + 0.0070001);
     thread.runPendingTask();
 
     EXPECT_EQ(16, thread.pendingDelayMs());
@@ -286,7 +286,7 @@
     EXPECT_EQ(16, thread.pendingDelayMs());
 
     // Tick, then double the interval.
-    timer->setMonotonicallyIncreasingTime(interval);
+    timer->setMonotonicTimeNow(interval);
     thread.runPendingTask();
 
     EXPECT_EQ(16, thread.pendingDelayMs());
@@ -300,7 +300,7 @@
     EXPECT_EQ(33, thread.pendingDelayMs());
 
     // Tick, then halve the interval.
-    timer->setMonotonicallyIncreasingTime(interval * 3);
+    timer->setMonotonicTimeNow(interval * 3);
     thread.runPendingTask();
 
     EXPECT_EQ(33, thread.pendingDelayMs());
@@ -332,8 +332,8 @@
         totalFrameTime += delayMs / 1000.0;
 
         // Run the callback exactly when asked
-        double now = timer->monotonicallyIncreasingTime() + delayMs / 1000.0;
-        timer->setMonotonicallyIncreasingTime(now);
+        double now = timer->monotonicTimeNow() + delayMs / 1000.0;
+        timer->setMonotonicTimeNow(now);
         thread.runPendingTask();
     }
     double averageInterval = totalFrameTime / static_cast<double>(numIterations);
@@ -361,7 +361,7 @@
 
     // Should run the activate task, and pick up a new timebase.
     timer->setActive(true);
-    timer->setMonotonicallyIncreasingTime(0);
+    timer->setMonotonicTimeNow(0);
     thread.runPendingTask();
 
     // Stop the timer
@@ -372,7 +372,7 @@
 
     // Start the timer again, but before the next tick time the timer previously
     // planned on using. That same tick time should still be targeted.
-    timer->setMonotonicallyIncreasingTime(0.004);
+    timer->setMonotonicTimeNow(0.004);
     timer->setActive(true);
     EXPECT_EQ(12, thread.pendingDelayMs());
 }
@@ -386,7 +386,7 @@
 
     // Should run the activate task, and pick up a new timebase.
     timer->setActive(true);
-    timer->setMonotonicallyIncreasingTime(0);
+    timer->setMonotonicTimeNow(0);
     thread.runPendingTask();
 
     // Stop the timer
@@ -397,7 +397,7 @@
 
     // Start the timer again, but before the next tick time the timer previously
     // planned on using. That same tick time should still be targeted.
-    timer->setMonotonicallyIncreasingTime(0.02);
+    timer->setMonotonicTimeNow(0.02);
     timer->setActive(true);
     EXPECT_EQ(13, thread.pendingDelayMs());
 }

Modified: trunk/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp (125801 => 125802)


--- trunk/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp	2012-08-16 19:50:22 UTC (rev 125801)
+++ trunk/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp	2012-08-16 19:54:00 UTC (rev 125802)
@@ -63,7 +63,7 @@
 
     // Trigger one frame, make sure the vsync callback is called
     elapsed += thread.pendingDelayMs() / 1000.0;
-    timeSource->setMonotonicallyIncreasingTime(elapsed);
+    timeSource->setMonotonicTimeNow(elapsed);
     thread.runPendingTask();
     EXPECT_TRUE(client.vsyncTicked());
     client.reset();
@@ -72,13 +72,13 @@
     controller.didBeginFrame();
 
     // Tell the controller the frame ended 5ms later
-    timeSource->setMonotonicallyIncreasingTime(timeSource->monotonicallyIncreasingTime() + 0.005);
+    timeSource->setMonotonicTimeNow(timeSource->monotonicTimeNow() + 0.005);
     controller.didFinishFrame();
 
     // Trigger another frame, make sure vsync runs again
     elapsed += thread.pendingDelayMs() / 1000.0;
-    EXPECT_TRUE(elapsed >= timeSource->monotonicallyIncreasingTime()); // Sanity check that previous code didn't move time backward.
-    timeSource->setMonotonicallyIncreasingTime(elapsed);
+    EXPECT_TRUE(elapsed >= timeSource->monotonicTimeNow()); // Sanity check that previous code didn't move time backward.
+    timeSource->setMonotonicTimeNow(elapsed);
     thread.runPendingTask();
     EXPECT_TRUE(client.vsyncTicked());
 }
@@ -98,7 +98,7 @@
 
     // Trigger one frame, make sure the vsync callback is called
     elapsed += thread.pendingDelayMs() / 1000.0;
-    timeSource->setMonotonicallyIncreasingTime(elapsed);
+    timeSource->setMonotonicTimeNow(elapsed);
     thread.runPendingTask();
     EXPECT_TRUE(client.vsyncTicked());
     client.reset();
@@ -108,8 +108,8 @@
 
     // Trigger another frame, make sure vsync callback runs again
     elapsed += thread.pendingDelayMs() / 1000.0;
-    EXPECT_TRUE(elapsed >= timeSource->monotonicallyIncreasingTime()); // Sanity check that previous code didn't move time backward.
-    timeSource->setMonotonicallyIncreasingTime(elapsed);
+    EXPECT_TRUE(elapsed >= timeSource->monotonicTimeNow()); // Sanity check that previous code didn't move time backward.
+    timeSource->setMonotonicTimeNow(elapsed);
     thread.runPendingTask();
     EXPECT_TRUE(client.vsyncTicked());
     client.reset();
@@ -119,13 +119,13 @@
 
     // Trigger another frame. Since two frames are pending, we should not draw.
     elapsed += thread.pendingDelayMs() / 1000.0;
-    EXPECT_TRUE(elapsed >= timeSource->monotonicallyIncreasingTime()); // Sanity check that previous code didn't move time backward.
-    timeSource->setMonotonicallyIncreasingTime(elapsed);
+    EXPECT_TRUE(elapsed >= timeSource->monotonicTimeNow()); // Sanity check that previous code didn't move time backward.
+    timeSource->setMonotonicTimeNow(elapsed);
     thread.runPendingTask();
     EXPECT_FALSE(client.vsyncTicked());
 
     // Tell the controller the first frame ended 5ms later
-    timeSource->setMonotonicallyIncreasingTime(timeSource->monotonicallyIncreasingTime() + 0.005);
+    timeSource->setMonotonicTimeNow(timeSource->monotonicTimeNow() + 0.005);
     controller.didFinishFrame();
 
     // Tick should not have been called
@@ -133,8 +133,8 @@
 
     // Trigger yet another frame. Since one frames is pending, another vsync callback should run.
     elapsed += thread.pendingDelayMs() / 1000.0;
-    EXPECT_TRUE(elapsed >= timeSource->monotonicallyIncreasingTime()); // Sanity check that previous code didn't move time backward.
-    timeSource->setMonotonicallyIncreasingTime(elapsed);
+    EXPECT_TRUE(elapsed >= timeSource->monotonicTimeNow()); // Sanity check that previous code didn't move time backward.
+    timeSource->setMonotonicTimeNow(elapsed);
     thread.runPendingTask();
     EXPECT_TRUE(client.vsyncTicked());
 }

Modified: trunk/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h (125801 => 125802)


--- trunk/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h	2012-08-16 19:50:22 UTC (rev 125801)
+++ trunk/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h	2012-08-16 19:54:00 UTC (rev 125802)
@@ -130,15 +130,15 @@
         return adoptRef(new FakeCCDelayBasedTimeSource(interval, thread));
     }
 
-    void setMonotonicallyIncreasingTime(double time) { m_monotonicallyIncreasingTime = time; }
-    virtual double monotonicallyIncreasingTime() const { return m_monotonicallyIncreasingTime; }
+    void setMonotonicTimeNow(double time) { m_monotonicTimeNow = time; }
+    virtual double monotonicTimeNow() const OVERRIDE { return m_monotonicTimeNow; }
 
 protected:
     FakeCCDelayBasedTimeSource(double interval, WebCore::CCThread* thread)
         : CCDelayBasedTimeSource(interval, thread)
-        , m_monotonicallyIncreasingTime(0) { }
+        , m_monotonicTimeNow(0) { }
 
-    double m_monotonicallyIncreasingTime;
+    double m_monotonicTimeNow;
 };
 
 class FakeCCFrameRateController : public WebCore::CCFrameRateController {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to