OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "cc/test/test_webkit_platform.h" | 5 #include "cc/test/test_webkit_platform.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 TestWebKitPlatform::TestWebKitPlatform() { | 9 TestWebKitPlatform::TestWebKitPlatform() { |
10 } | 10 } |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 WebKit::WebThread* TestWebKitPlatform::currentThread() { | 28 WebKit::WebThread* TestWebKitPlatform::currentThread() { |
29 webkit_glue::WebThreadImplForMessageLoop* thread = | 29 webkit_glue::WebThreadImplForMessageLoop* thread = |
30 static_cast<WebThreadImplForMessageLoop*>(current_thread_slot_.Get()); | 30 static_cast<WebThreadImplForMessageLoop*>(current_thread_slot_.Get()); |
31 if (thread) | 31 if (thread) |
32 return (thread); | 32 return (thread); |
33 | 33 |
34 scoped_refptr<base::MessageLoopProxy> message_loop = | 34 scoped_refptr<base::MessageLoopProxy> message_loop = |
35 base::MessageLoopProxy::current(); | 35 base::MessageLoopProxy::current(); |
36 if (!message_loop) | 36 if (!message_loop.get()) |
37 return NULL; | 37 return NULL; |
38 | 38 |
39 thread = new WebThreadImplForMessageLoop(message_loop); | 39 thread = new WebThreadImplForMessageLoop(message_loop.get()); |
40 current_thread_slot_.Set(thread); | 40 current_thread_slot_.Set(thread); |
41 return thread; | 41 return thread; |
42 } | 42 } |
43 | 43 |
44 double TestWebKitPlatform::currentTime() { | 44 double TestWebKitPlatform::currentTime() { |
45 return base::Time::Now().ToDoubleT(); | 45 return base::Time::Now().ToDoubleT(); |
46 } | 46 } |
47 | 47 |
48 double TestWebKitPlatform::monotonicallyIncreasingTime() { | 48 double TestWebKitPlatform::monotonicallyIncreasingTime() { |
49 return base::TimeTicks::Now().ToInternalValue() / | 49 return base::TimeTicks::Now().ToInternalValue() / |
50 static_cast<double>(base::Time::kMicrosecondsPerSecond); | 50 static_cast<double>(base::Time::kMicrosecondsPerSecond); |
51 } | 51 } |
52 | 52 |
53 } | 53 } |
OLD | NEW |