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

Side by Side Diff: cc/test/test_webkit_platform.cc

Issue 11344004: Remove WebKit::Platform dependencies from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix webkit_compositor_bindings_unittests Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/test_webkit_platform.h ('k') | cc/test/web_compositor_initializer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/test/test_webkit_platform.h"
6
7 namespace cc {
8
9 TestWebKitPlatform::TestWebKitPlatform() {
10 }
11
12 TestWebKitPlatform::~TestWebKitPlatform() {
13 }
14
15 WebKit::WebCompositorSupport* TestWebKitPlatform::compositorSupport() {
16 return &compositor_support_;
17 }
18
19 void TestWebKitPlatform::cryptographicallyRandomValues(
20 unsigned char* buffer, size_t length) {
21 base::RandBytes(buffer, length);
22 }
23
24 WebKit::WebThread* TestWebKitPlatform::createThread(const char* name) {
25 return new webkit_glue::WebThreadImpl(name);
26 }
27
28 WebKit::WebThread* TestWebKitPlatform::currentThread() {
29 webkit_glue::WebThreadImplForMessageLoop* thread =
30 static_cast<WebThreadImplForMessageLoop*>(current_thread_slot_.Get());
31 if (thread)
32 return (thread);
33
34 scoped_refptr<base::MessageLoopProxy> message_loop =
35 base::MessageLoopProxy::current();
36 if (!message_loop)
37 return NULL;
38
39 thread = new WebThreadImplForMessageLoop(message_loop);
40 current_thread_slot_.Set(thread);
41 return thread;
42 }
43
44 double TestWebKitPlatform::currentTime() {
45 return base::Time::Now().ToDoubleT();
46 }
47
48 double TestWebKitPlatform::monotonicallyIncreasingTime() {
49 return base::TimeTicks::Now().ToInternalValue() /
50 static_cast<double>(base::Time::kMicrosecondsPerSecond);
51 }
52
53 }
OLDNEW
« no previous file with comments | « cc/test/test_webkit_platform.h ('k') | cc/test/web_compositor_initializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698