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

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp

Issue 2148363004: Use std::unique_ptr<> for WebTaskRunner::clone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 "core/svg/graphics/SVGImage.h" 5 #include "core/svg/graphics/SVGImage.h"
6 6
7 #include "core/svg/graphics/SVGImageChromeClient.h" 7 #include "core/svg/graphics/SVGImageChromeClient.h"
8 #include "platform/SharedBuffer.h" 8 #include "platform/SharedBuffer.h"
9 #include "platform/Timer.h" 9 #include "platform/Timer.h"
10 #include "platform/geometry/FloatRect.h" 10 #include "platform/geometry/FloatRect.h"
(...skipping 21 matching lines...) Expand all
32 private: 32 private:
33 void postTask(const WebTraceLocation&, Task*) override { } 33 void postTask(const WebTraceLocation&, Task*) override { }
34 void postDelayedTask(const WebTraceLocation&, Task* task, double) override 34 void postDelayedTask(const WebTraceLocation&, Task* task, double) override
35 { 35 {
36 if (m_currentTask) 36 if (m_currentTask)
37 delete m_currentTask; 37 delete m_currentTask;
38 m_currentTask = task; 38 m_currentTask = task;
39 39
40 } 40 }
41 bool runsTasksOnCurrentThread() override { return true; } 41 bool runsTasksOnCurrentThread() override { return true; }
42 WebTaskRunner* clone() override { return nullptr; } 42 std::unique_ptr<WebTaskRunner> clone() override { return nullptr; }
43 double virtualTimeSeconds() const override { return 0.0; } 43 double virtualTimeSeconds() const override { return 0.0; }
44 double monotonicallyIncreasingVirtualTimeSeconds() const override { return m _time; } 44 double monotonicallyIncreasingVirtualTimeSeconds() const override { return m _time; }
45 45
46 double m_time; 46 double m_time;
47 Task* m_currentTask; 47 Task* m_currentTask;
48 }; 48 };
49 49
50 class MockTimer : public Timer<SVGImageChromeClient> { 50 class MockTimer : public Timer<SVGImageChromeClient> {
51 typedef void (SVGImageChromeClient::*TimerFiredFunction)(Timer*); 51 typedef void (SVGImageChromeClient::*TimerFiredFunction)(Timer*);
52 public: 52 public:
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 EXPECT_TRUE(chromeClient.isSuspended()); 186 EXPECT_TRUE(chromeClient.isSuspended());
187 EXPECT_FALSE(timer->isActive()); 187 EXPECT_FALSE(timer->isActive());
188 188
189 // Simulate a draw. This should resume the animation again. 189 // Simulate a draw. This should resume the animation again.
190 pumpFrame(); 190 pumpFrame();
191 EXPECT_FALSE(chromeClient.isSuspended()); 191 EXPECT_FALSE(chromeClient.isSuspended());
192 EXPECT_TRUE(timer->isActive()); 192 EXPECT_TRUE(timer->isActive());
193 } 193 }
194 194
195 } // namespace blink 195 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698